U
user3575995
Guest
What is the best method using perl to determine if a tcp port is available. I want to select a port in advance of creating a network service. This is all to be done using automation and the requirement is to build a configuration for the service including an available tcp port within a range used by the service.
Possible methods under consideration:
What is the best method and why? I don't like the test bind very much because it requires root for privileged ports and if something goes wrong with the script it might leave all tested ports in time_wait. I like the Linux:roc::Net::TCP because it's fast but it's not portable.
Continue reading...
Possible methods under consideration:
- IO::Socket to test bind on a candidate port.
- Net::Telnet to test connecting to the candidate port
- Linux:roc::Net::TCP
What is the best method and why? I don't like the test bind very much because it requires root for privileged ports and if something goes wrong with the script it might leave all tested ports in time_wait. I like the Linux:roc::Net::TCP because it's fast but it's not portable.
Continue reading...