in reply to Optimized remote ping
Try Net::Ping in syn/ack mode. With this method you ping all the hosts in the first pass and then gather the responses in the second pass:
# Like tcp protocol, but with many hosts $p = Net::Ping->new( "syn" ); $p->port_number( getservbyname( "http", "tcp" ) ); ### send all the pings first foreach $host ( @host_array ) { $p->ping( $host ); } ### Then check which hosts responded. while( ( $host, $rtt, $ip ) = $p->ack ) { print "HOST: $host [$ip] ACKed in $rtt seconds.\n"; }
In this way, all the delays are overlapped and it reduces the overall runtime significantly.
It is harder to use; so read the docs carefully.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Optimized remote ping (syn/ack)
by themonk (Acolyte) on Jul 17, 2015 at 18:06 UTC | |
by themonk (Acolyte) on Jul 17, 2015 at 18:45 UTC | |
by BrowserUk (Patriarch) on Jul 17, 2015 at 19:05 UTC | |
by themonk (Acolyte) on Jul 17, 2015 at 19:49 UTC | |
by afoken (Chancellor) on Jul 17, 2015 at 20:03 UTC | |
|