… | |
… | |
26 | use common::sense; |
26 | use common::sense; |
27 | |
27 | |
28 | use AnyEvent; |
28 | use AnyEvent; |
29 | |
29 | |
30 | BEGIN { |
30 | BEGIN { |
31 | our $VERSION = '1.14'; |
31 | our $VERSION = '1.15'; |
32 | our @ISA = qw(Exporter); |
32 | our @ISA = qw(Exporter); |
33 | |
33 | |
34 | require Exporter; |
34 | require Exporter; |
35 | #Exporter::export_ok_tags (keys %EXPORT_TAGS); |
35 | #Exporter::export_ok_tags (keys %EXPORT_TAGS); |
36 | |
36 | |
… | |
… | |
143 | |
143 | |
144 | sub icmp_ping($$$&) { |
144 | sub icmp_ping($$$&) { |
145 | _send_req _req_icmp_ping @_; |
145 | _send_req _req_icmp_ping @_; |
146 | } |
146 | } |
147 | |
147 | |
148 | our $ICMP4_FH; |
|
|
149 | our $ICMP4_W = (open $ICMP4_FH, "<&=$ICMP4_FD") && AE::io $ICMP4_FH, 0, \&_recv_icmp4; |
148 | our $ICMP4_FH; our $ICMP4_W = $ICMP4_FD >= 0 && (open $ICMP4_FH, "<&=$ICMP4_FD") && AE::io $ICMP4_FH, 0, \&_recv_icmp4; |
150 | our $ICMP6_FH; |
|
|
151 | our $ICMP6_W = (open $ICMP6_FH, "<&=$ICMP6_FD") && AE::io $ICMP6_FH, 0, \&_recv_icmp6; |
149 | our $ICMP6_FH; our $ICMP6_W = $ICMP6_FD >= 0 && (open $ICMP6_FH, "<&=$ICMP6_FD") && AE::io $ICMP6_FH, 0, \&_recv_icmp6; |
152 | |
150 | |
153 | =item AnyEvent::FastPing::register_cb \&cb |
151 | =item AnyEvent::FastPing::register_cb \&cb |
154 | |
152 | |
155 | Register a callback that is called for every received ping reply |
153 | Register a callback that is called for every received ping reply |
156 | (regardless of whether a ping is still in process or not and regardless of |
154 | (regardless of whether a ping is still in process or not and regardless of |