[stackoverflow] [progress Openedge Abl] Best Perl Method To Determine If A Tcp Port Is...

Status
Not open for further replies.
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:

  1. IO::Socket to test bind on a candidate port.
  2. Net::Telnet to test connecting to the candidate port
  3. Linux::proc::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::proc::Net::TCP because it's fast but it's not portable.

Continue reading...
 
Status
Not open for further replies.
Top