各位好 我用socket的方式启动tornado 方式如下:
sockets = tornado.netutil.bind_sockets(options.options.port)
tornado.process.fork_processes(0)
server = HTTPServer(app, xheaders=True)
server.add_sockets(sockets)
try:
ioloop.IOLoop.instance().start()
except KeyboardInterrupt:
ioloop.IOLoop.instance().stop()
服务可以正常启动,但是我用http request去请求报错:
Traceback (most recent call last):
File "manage.py", line 50, in <module>
run()
File "manage.py", line 38, in run
sockets = tornado.netutil.bind_sockets(options.options.port)
File "/usr/local/lib/python3.5/dist-packages/tornado/netutil.py", line 194, in bind_sockets
sock.bind(sockaddr)
OSError: [Errno 98] Address already in use
请问如何解决,谢谢
Cats萌萌
相关分类