Subject: | Non-blocking connect does not work |
The use of Blocking => 0 in the IO::Socket::INET6->new() constructor
does not behave as expected - the socket still blocks on a connect call.
I've attached a script which demonstrates this behavior.
I believe this is because $sock->blocking(0) is being called before
$sock->socket() is called.
Subject: | sock.pl |
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::INET;
use IO::Socket::INET6;
my $sock = IO::Socket::INET->new(
Proto => 'tcp',
PeerAddr => '1.1.1.1',
PeerPort => 80,
Blocking => 0,
);
print "SOCK: $sock\n";
print "Next call will block...\n";
my $sock2 = IO::Socket::INET6->new(
Proto => 'tcp',
PeerAddr => '1::1',
PeerPort => 80,
Blocking => 0,
);
print "Sock2: $sock2\n";