AnyEvent-FastPing

 view release on metacpan or  search on metacpan

FastPing.pm  view on Meta::CPAN

A value of C<0> selects the fastest possible speed (currently no faster
than 1_000_000 packets/s).

=item $pinger->max_rtt ($seconds)

If your idle callback were called instantly after all ranges were
exhausted and you destroyed the object inside (which is common), then
there would be no chance to receive some replies, as there would be no
time of the packet to travel over the network.

This can be fixed by starting a timer in the idle callback, or more simply
by selecting a suitable C<max_rtt> value, which should be the maximum time
you allow a ping packet to travel to its destination and back.

The pinger thread automatically waits for this amount of time before becoming idle.

The default is currently C<0.5> seconds, which is usually plenty.

=item $pinger->add_range ($lo, $hi[, $interval])

Ping the IPv4 (or IPv6, but see below) address range, starting at binary

README  view on Meta::CPAN


        A value of 0 selects the fastest possible speed (currently no faster
        than 1_000_000 packets/s).

    $pinger->max_rtt ($seconds)
        If your idle callback were called instantly after all ranges were
        exhausted and you destroyed the object inside (which is common),
        then there would be no chance to receive some replies, as there
        would be no time of the packet to travel over the network.

        This can be fixed by starting a timer in the idle callback, or more
        simply by selecting a suitable "max_rtt" value, which should be the
        maximum time you allow a ping packet to travel to its destination
        and back.

        The pinger thread automatically waits for this amount of time before
        becoming idle.

        The default is currently 0.5 seconds, which is usually plenty.

    $pinger->add_range ($lo, $hi[, $interval])

bin/fastping  view on Meta::CPAN

   for my $iter (1 .. $count) {
      $pinger->add_range (@$_)
         for @ranges;

      $pinger->on_idle (my $done = AE::cv);
      $pinger->start;
      $done->wait;
   }

   {
      my $wait_w = AE::timer $wait, 0, my $done = AE::cv;
      $done->wait;
   }
}



( run in 1.070 second using v1.01-cache-2.11-cpan-49f99fa48dc )