check for unused ports and then grab one

Peter Hansen peter at engcorp.com
Mon Sep 13 22:38:20 EDT 2004


Brad Tilley wrote:

> Peter Hansen wrote:
>>I've
>> never had to do what you are trying to do, thus my curiosity...
> 
> I use Python for administering windows clients. This software will 
> facilitate that... that's all.
> 
> The server (which resides on the win clients) has to start and configure 
> itself dynamically. Using the same port number isn't necessary and I 
> prefer not to hard code it. Each server will have a client component 
> that grabs the current IP (dhcp) and port number the server is using and 
> then sends it to a separate machine (sys-admin workstation) that is 
> collecting a list of ips and ports for later usage.

Thanks for the explanation Brad.  Interesting usage.  I suspect
in the same situation I'd make the choice to assign a port to
the service permanently (and hardcode or whatever), but I have
to admit I don't have all the details so maybe I'd take your
approach, too. :-)

-Peter



More information about the Python-list mailing list