server.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:rabbitChat 作者: anirbanroydas 项目源码 文件源码
def main():
    tornado.options.parse_command_line()
    print '\ncreating app=Applicatoin()'
    app = Application()
    print '\napp= Aapplication() created -> app : ', app
    http_server = tornado.httpserver.HTTPServer(app)
    http_server.listen(options.port)
    print "\nStarting server on http://127.0.0.1:%s" % options.port

    try:

        tornado.ioloop.IOLoop.current().start()
    except KeyboardInterrupt:
        print '\n\nEXCEPTION KEYBOARDINTERRUPT INITIATED\n'
        print "Stopping Server....\n"
        print 'closing all websocket connections objects and corresponsding pika client objects\n'
        # wsparticipants = apps.main.views.websocketParticipants
        # for ws in wsparticipants:
        #     print '\nCLOSING WS.on_close object : ', ws
        #     ws.on_close()

        # apps.main.views.websocketParticipants = []
        print "\nServer Stopped.\n"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号