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"
评论列表
文章目录