SocketServer: Address already in use

Thomas Guettler guettli at thomas-guettler.de
Fri May 16 15:11:59 EDT 2003


Hi!

I am playing with the SocketServer module.

If I kill the server and restart it again. I get the following
stacktrace:
Traceback (most recent call last):
  File "port-forwarding.py", line 13, in ?
    myServer=SocketServer.ThreadingTCPServer(('', 2000), MyHandler)
  File "/usr/lib/python2.2/SocketServer.py", line 329, in __init__
    self.server_bind()
  File "/usr/lib/python2.2/SocketServer.py", line 340, in server_bind
    self.socket.bind(self.server_address)
socket.error: (98, 'Address already in use')

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?

 thomas

-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de






More information about the Python-list mailing list