Created
December 16, 2014 10:45
-
-
Save olegwtf/ebfc9dcadb98eafe2216 to your computer and use it in GitHub Desktop.
IO::Socket::IP bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use IO::Socket::IP; | |
use Socket 'IPPROTO_TCP'; | |
use IO::Select; | |
my ($err, @res) = Socket::getaddrinfo("www.google.com", 80, {protocol => IPPROTO_TCP}); | |
die $err if $err; | |
my $ip = IO::Socket::IP->new(Blocking => 0, PeerAddrInfo => \@res) or die $@; | |
my $sel = IO::Select->new($ip); | |
$sel->can_write(10) or die "can't connect in 10 sec"; | |
warn "Connected!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment