http://www.perlmonks.org?node_id=761745


in reply to Re: Re: Net::Ping the mini series (UDP Pings)
in thread Net::Ping, the mini series

I know this is an old post, but I think I might know why your program in saying 'yes' all the time.

The reason it might be always reporting that the server is up might be that if it is a linux box, iptables might have icmp host unreachable turned off. If that's the case then when your send call is done, it returns without error and in the gap between the nth and the (n+1)th send call, the OS reports an ICMP host unreachable, but due to the iptables rule, it gets dropped at the point of entry, never making it to the program. So your subsequent sends do not see any errors reported by the previous ones and it looks as if all is well.

Replies are listed 'Best First'.
Re^4: Net::Ping the mini series (UDP Pings)
by Anonymous Monk on Dec 23, 2009 at 22:54 UTC
    Even for me it does not work on windows as well. But it works for TCP. Can anyone know how to make it work with UDP? Thanks in advance, kuntalm@hotmail.com