in reply to Non-blocking pings on Win32

I think Net::Ping can operate in non-blocking mode natively, with the 'syn' protocol. You don't need to fork at all. The documentation for Net::Ping on CPAN is here.

The following example was pulled from CPAN directly.
# Like tcp protocol, but with many hosts $p = Net::Ping->new("syn"); $p->{port_num} = getservbyname("http", "tcp"); foreach $host (@host_array) { $p->ping($host); } while (($host,$rtt,$ip) = $p->ack) { print "HOST: $host [$ip] ACKed in $rtt seconds.\n"; }

Replies are listed 'Best First'.
Re: Re: Non-blocking pings on Win32
by TheFluffyOne (Beadle) on Nov 24, 2003 at 22:36 UTC

    Thanks Roger. I'm a little concerned I might upset our security people by using Syn scans, but it looks like it could be a good solution so I'll check it out when I'm back in work.

    Cheers,

    Gordon.

      Also be aware that the sending of SYN packets through an interface may require elevated privileges for the user and/or application.

       

      perl -le "print+unpack'N',pack'B32','00000000000000000000001010010011'"