How to free a port that has been used by a python server?

Alex cut_me_out at hotmail.com
Sat Jun 3 12:06:48 EDT 2000


Thanks for the advice, Johannes.  I put the serve_forever call in a
'try/finally', to make sure the socket got closed.  I am suprised that
it doesn't help to just put 'self.socket.close ()' in a '__del__'
method.  In fact, even a method 'proxy.finalize' containing
'self.socket.close ()', and calling that in the 'finally:' block did not
free the socket.

But I have something that is much easier to debug now.

Thanks again.
Alex.



More information about the Python-list mailing list