Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3 from Hugmeir/master

Handle systems without getprotobyname()
  • Loading branch information...
commit 1b2f8f326d904cc5fc36cac174d2c741bd8d78ff 2 parents e1adebf + 68a1de5
Rocco Caputo authored
Showing with 2 additions and 4 deletions.
  1. +1 −2  lib/POE/Component/Client/Ping.pm
  2. +1 −2  t/03_provided_socket.t
3  lib/POE/Component/Client/Ping.pm
View
@@ -164,8 +164,7 @@ sub _create_handle {
my ($kernel, $heap) = @_;
DEBUG_SOCKET and warn "opening a raw socket for icmp";
- my $protocol = (getprotobyname('icmp'))[2]
- or die "can't get icmp protocol by name: $!";
+ my $protocol = Socket::IPPROTO_ICMP;
my $socket = gensym();
socket($socket, PF_INET, SOCK_RAW, $protocol)
3  t/03_provided_socket.t
View
@@ -124,8 +124,7 @@ sub client_stop {
use Symbol qw(gensym);
use Socket;
-my $protocol = (getprotobyname('icmp'))[2]
- or die "can't get icmp protocol by name: $!";
+my $protocol = Socket::IPPROTO_ICMP;
my $socket = gensym();
socket($socket, PF_INET, SOCK_RAW, $protocol)
Please sign in to comment.
Something went wrong with that request. Please try again.