[melbourne-pug] SOAPpy port reuse

Mike Dewhirst miked at dewhirst.com.au
Sun Nov 18 12:46:25 CET 2007


Maurice LING wrote:
> 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).

This sounds like the operating system doesn't understand that your 
server (or the Python interpreter) owns the port. OSs usually rely on 
apps or libraries to pull all the strings. Maybe the SOAPpy code just 
opens the port but doesn't close it on exit. Does it need to be 
explicitly closed?

Maybe you need to add a server.close_port() function to the functionlist 
and find a way to call it before killing the process ???

Mike

> 
> Thanks in advance.
> 
> Cheers
> maurice
> _______________________________________________
> melbourne-pug mailing list
> melbourne-pug at python.org
> http://mail.python.org/mailman/listinfo/melbourne-pug
> 
> 



More information about the melbourne-pug mailing list