NAME
Net::Async::Ping::ICMP
VERSION
version 0.004000
DESCRIPTION
This is the ICMP part of Net::Async::Ping. See that documentation for full details.
ICMP methods
This module will first attempt to use a ping socket to send its ICMP packets, which does not need root privileges. These are only supported on Linux, and only when the group is stipulated in /proc/sys/net/ipv4/ping_group_range
. Failing that, the module will use a raw socket limited to the ICMP protocol, which will fail if attempted from a non-privileged account.
ping socket advantages
- doesn't require root/admin privileges
- better performance, as the kernel is handling the reply to request packet matching
raw socket advantages
Additional options
To disable the attempt to send from a ping socket, set use_ping_socket
to 0 when initiating the object:
my $p = Net::Async::Ping->new(
icmp => {
use_ping_socket => 0,
},
);
Return value
Net::Async::Ping::ICMP will return the hires time on success. On failure, it will return the future from IO::Async::Resolver if that failed. Otherwise, it will return as a future failure:
- "ICMP Unreachable"
-
ICMP response was ICMP_UNREACHABLE
- "ICMP Timeout"
-
ICMP response was ICMP_TIME_EXCEEDED
- "Receive error"
-
An error was received from IO::Async::Socket.
NAME
Net::Async::Ping::ICMP
AUTHORS
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
Alexander Hartmaier <abraxxa@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Arthur Axel "fREW" Schmidt, Alexander Hartmaier.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.