'Address already in use' ... with TCPServer
ochichinyezaboombwa at yahoo.com
Fri Jan 30 08:43:33 CET 2009
I bet everybody knows exactly what I am about to ask about:
A server serves for a while, then drops on its knees, tries to restart, but... the port is busy, the TCP says "Address already in use".
And, I think I know the answer:
The problem is: I am trying to use a very-high level far-away-from-socket class ("TCPServer");
or to be 100% honest, - an even higher-level async version of it
(like in http://www.python.org/doc/2.6/library/socketserver.html?highlight=tcpserver#asynchronous-mixins).
What I came up with so far is this:
>>> from SocketServer import *
>>> s = TCPServer( ('', 32123), None)
['RequestHandlerClass', '__doc__', '__init__', '__module__', 'address_family', 'allow_reuse_address', 'close_request', 'fileno', 'finish_request', 'get_request', 'handle_error', 'handle_request', 'process_request', 'request_queue_size', 'serve_forever', 'server_activate', 'server_address', 'server_bind', 'server_close', 'socket', 'socket_type', 'verify_request']
Aha! My bet is (was):
should do the trick.
But it doesn't. (:___.
The question is:
how to set up TCPServer correctly to reuse the port right away.
Please give a hand.
I acknowledge that I am trying to hack it rather then looking at all the web 1st:
sorry if I am spamming this list while good documentation exists. But does it?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list