SimpleXMLRPCServer Releasing Ports

Eddie Corns eddie at holyrood.ed.ac.uk
Tue Oct 8 10:57:28 EDT 2002


John Abel <john.abel at pa.press.net> writes:

>Hi,

>I have a script running, using SimpleXMLRPCServer, which works OK. 
> Except, when I stop, and restart the script, I receive the error, 
>"Address already in use".  Is there something I can do, like a 
>destructor, to tidy up, so that the script can be restarted?

I think you have to wait for a couple of minutes for the OS to release the
socket.  IIRC it hangs on to it in case there is any more traffic (ie it wants
to be sure both ends are closed).  If there's any way at all of clearing it
early (which may not even be a good idea - in theory anyway) it will be by
manipulating the underlying socket.

Eddie




More information about the Python-list mailing list