SocketServer: Address already in use

"Martin v. Löwis" martin at v.loewis.de
Sat May 17 06:33:48 EDT 2003


Thomas Guettler wrote:
> After some minutes the socket gets released and I can restart the
> server. How can I close the socket of the server cleanly so that I can
> reuse the adress again at once?

You should set the SO_REUSEADDR socket option after creating the socket.
Alternatively, you should properly shut down all connections instead of
just exiting when being killed.

Regards,
Martin





More information about the Python-list mailing list