ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-FastPing/FastPing.pm
(Generate patch)

Comparing AnyEvent-FastPing/FastPing.pm (file contents):
Revision 1.11 by root, Mon Jan 31 05:35:48 2011 UTC vs.
Revision 1.12 by root, Tue Feb 1 04:06:24 2011 UTC

92for(1..10) { 92for(1..10) {
93my $p = new AnyEvent::FastPing;#d# 93my $p = new AnyEvent::FastPing;#d#
94$p->interval (0); 94$p->interval (0);
95$p->max_rtt (0.5); 95$p->max_rtt (0.5);
96#$p->add_range (v127.0.0.1, v127.255.255.254, 0); 96#$p->add_range (v127.0.0.1, v127.255.255.254, 0);
97$p->add_range (v127.0.0.1, v127.0.0.1, 0);
97$p->add_range (v1.0.0.1, v1.255.255.254, 0); 98#$p->add_range (v1.0.0.1, v1.255.255.254, 0);
98$p->on_idle (my $cv = AE::cv); 99$p->on_idle (my $cv = AE::cv);
99my $cnt; 100my $cnt;
100$p->on_recv (sub { 101$p->on_recv (sub {
101 $cnt++; 102 $cnt++;
102}); 103});
103$p->start; 104$p->start;
105
106{
107 my $p = new AnyEvent::FastPing;#d#
108 $p->interval (0);
109 $p->max_rtt (0.5);
110 $p->add_hosts ([v0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2, (v0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1)x8, v0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.3], 0);
111 my $cnt;
112 $p->on_recv (sub {
113 use Data::Dump; ddx \@_;
114 });
115 $p->on_idle (sub {
116 undef $p;
117 });
118 $p->start;
119}
120
104$cv->recv; 121$cv->recv;
105warn $cnt; 122warn $cnt;
106} 123}
107 124
108=item AnyEvent::FastPing::icmp_ping [ranges...], $send_interval, $payload, \&callback 125=item AnyEvent::FastPing::icmp_ping [ranges...], $send_interval, $payload, \&callback

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines