Пример #1
0
 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()
Пример #2
0
 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()
Пример #3
0
 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()
Пример #4
0
 def routine(self):
     asyncore.loop()
Пример #5
0
def main():
    server = HTTPServer(('', 5672), 10)
    asyncore.loop()
Пример #6
0
 def run(self):
     self.listen(num=self.backlog)
     asyncore_epoll.loop(timeout=self.poll_interval, poller=asyncore_epoll.epoll_poller)