Tornado multi-process startup server reported an error

Hello, everyone. The way I start tornado with socket is as follows:
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 ()

The

service starts normally, but I use http request to request an error:

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

could you tell me how to solve it? thank you

Dec.27,2021

you can see from the error message that the current port is already occupied. It is recommended to try another port

Menu