perlknight has asked for the wisdom of the Perl Monks concerning the following question:
All,
below is a code snipet from the doc of net ping. AFAIK, this is suppose to test if www port is open (listening).
I tried using this, but it seems to fail. I changed "www" to ssh and telnet. I ran it on a host that should have failed. Anyone knows what this did not fail?$p = Net::Ping->new("tcp", 2); # Try connecting to the www port instead of the echo port $p->{port_num} = getservbyname("http", "tcp"); #while ($stop_time > time()) #{ print "$host not reachable ", scalar(localtime()), "\n" unless $p->ping($host); sleep(300); #} undef($p);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: net ping question
by gellyfish (Monsignor) on Apr 15, 2005 at 09:48 UTC | |
by perlknight (Pilgrim) on Apr 15, 2005 at 15:01 UTC | |
Re: net ping question
by moot (Chaplain) on Apr 15, 2005 at 04:43 UTC |
Back to
Seekers of Perl Wisdom