Greetings Brothers (of any gender),
I have an app that starts up a server that binds to a TCP port. It has a default port number, but can bind to any port. There is a high probability that at some point, more than one of these servers will be running on the same system at the same time. I want to make sure that second and subsequent servers don't die on startup just because they picked a port that another server is already using.
What would be the best way to determine what ports are available on the local system? I could use Net::Netstat::Wrapper, I believe, but I'd like to avoid depending on an external app (netstat), if possible.
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."