in reply to Re: Net::ping is very unstable
in thread Net::ping is very unstable

the host is pingable by OS's "ping" command,but not pingable by this script.
but some hosts in other net is pingable by this script.

Replies are listed 'Best First'.
Re^3: Net::ping is very unstable
by Corion (Patriarch) on Apr 09, 2015 at 11:50 UTC

    The ping command sends ICMP packets. Your code sends SYN packets and expects ACK replies.

    I recommend you consult with your network administrator how to best check the connectivity between hosts on your network.

      I see.but I use "Net::Ping->new('icmp');",the script runs very slowly.
      in fact I check whether remote host opens specific port or not.for speed,I first have to use "Net::Ping" to check the host is alive or not.
      Can you give better advice?

Re^3: Net::ping is very unstable
by basiliscos (Pilgrim) on Apr 12, 2015 at 08:33 UTC

    You can try to use Net::Ping::External, which actually invokes ping command.

    Creation of ICMP-packets requires special privileges on some systems (e.g. suid on linux), so, it is a bit not-convenient to use ICMP-protocol from perl. ping command already has that privilege/capability, and it is more-or-less safe to use it from security point of view.

    WBR, basiliscos.