Main client loop.

def serve_forever(self):
        """Main client loop."""

        # Test if client and server are in the same major version
        if not self.login():
            logger.critical("The server version is not compatible with the client")
            self.end()
            return self.client_mode

        exitkey = False
        try:
            while True and not exitkey:
                # Update the stats
                cs_status = self.update()

                # Update the screen
                if not self.quiet:
                    exitkey = self.screen.update(self.stats,
                                                 cs_status=cs_status,
                                                 return_to_browser=self.return_to_browser)

                # Export stats using export modules
                self.stats.export(self.stats)
        except Exception as e:
            logger.critical(e)
            self.end()

        return self.client_mode