def start(self): logging.info('Listening on {}:{}'.format(self.host, self.port)) try: asyncore.loop(5, poller=asyncore.epoll_poller) except Exception as e: logging.exception('Server exception') finally: self.close()
def serve_forever(self): try: asyncore.loop(timeout=5, use_poll=True, poller=asyncore.epoll_poller) except KeyboardInterrupt: log.debug("Worker shutdown") finally: self.close()
def serve_forever(self): try: info("Starting server at %s:%s" % (self.host, self.port)) asyncore.loop(timeout=2, poller=asyncore.epoll_poller) except Exception: exception("Server got error") except BaseException: info("Server shutdown") finally: info("Server exit") self.close()
def routine(self): asyncore.loop()
def main(): server = HTTPServer(('', 5672), 10) asyncore.loop()
def run(self): self.listen(num=self.backlog) asyncore_epoll.loop(timeout=self.poll_interval, poller=asyncore_epoll.epoll_poller)