[Twisted-Python] How to get an unused port

Gabriel Rossetti mailing_lists at evotex.ch
Wed Feb 27 02:06:05 MST 2008


Hello,

I need to be able to get an unused port for a server, it will then 
communicate it to a third party.
I don't have any restrictions other than it shouldn't be a known used 
port (one used by other apps (above 1023)), but for that I'll probably 
have to create a list and verify manually. Does anyone know how to do 
this (without iterating all ports and trying), it must be possible since 
a client gets the next unused port from the OS, I'd like to do this with 
Twisted if possible.

Thanks,
Gabriel




More information about the Twisted-Python mailing list