SOAPpy port reuse

Diez B. Roggisch deets at nospam.web.de
Sun Nov 18 08:43:40 EST 2007


Maurice LING schrieb:
> Hi,
> 
> I have a problem:
> 
> 1. Assuming that my application is a SOAP server that uses SOAPpy,
> 2. I am given port 35021 for use.
> 
> What I normally do (simply) is:
> 
> functionlist = [<some exposed functions>]
> import SOAPpy
> server = SOAPpy.SOAPServer((<some host>, 35021))
> for func in functionlist: server.registerFunction(func)
> server.serve_forever()
> 
> My question is: How can I shutdown this server and reuse port 35021 when 
> my functionlist changes?
> 
> Currently, after killing the python process which runs this SOAP server, 
> the port (35021 in this case) cannot be re-used, as though it is still 
> phantom-ly bounded to some process (which should have been killed).

It shouldn't be that way. Either you still have some process lying 
around hogging the port. Or the OS needs a while to re-enable the port 
for allocation. That happened to me quite a few times.

Shutting down gracefully might speed up things I guess.

Diez



More information about the Python-list mailing list