I faced error 98, address already in use problem while I kill an running python TCPServer server and try to re-start it.
I noticed there is other article, suggest to sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) or set TCPServer.allow_reuse_address = True.
But I still faced the same problem, is there any other reason for this?
I am using RedHat EL 6.2, Python 2.6.
Thanks
The code I used was:
TCPServer.allow_reuse_address = True
TCPServer.__init__(self, (gethostname(), self.SERVER_PORT),scheddRequestHandler)
This keeps on getting me the error 98.
However if I changed to:
TCPServer.allow_reuse_address = True
TCPServer((gethostname(),self.SERVER_PORT),scheddRequestHandler)
The error is gone.
I am not quite clear why this happened?