develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #116433] Get IO::Socket::IP into core for seemless v4/v6 support

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
April 25, 2013 21:04
Subject:
Re: [perl #116433] Get IO::Socket::IP into core for seemless v4/v6 support
Message ID:
CA+vYcVybmKYaOA_5caZ2m428WUa=UXeLuP26=5XE1G8ABLKJHg@mail.gmail.com
On Wed, Apr 24, 2013 at 11:25 AM, Matthew Horsfall (alh) <wolfsage@gmail.com
> wrote:

> On Tue, Apr 23, 2013 at 12:34 PM, Matthew Horsfall (alh) <
>> wolfsage@gmail.com> wrote:
>>
>>>
>>> Currently discussing options with LeoNerd to get this moving along.
>>>
>>> -- Matthew Horsfall (alh)
>>>
>>>
>>>
>>
> LeoNerd pushed a dev branch to CPAN of IO::Socket::IP containing a fix for
> this, I've updated and tested it locally and it appears to solve the issue.
>
> rjbs has pulled it into the smoke me branch and now we're waiting testing
> results.
>
>
I built this branch as of

smoke-me/rjbs/io-socket-ip 2013-04-24.15:51:27
e037cbdbe1612475d113ff20adbd304172b1578e v5.17.10-53-ge037cbd


and got the following new test failures on VMS:

   cpan/IO-Socket-IP/t/11sockopts ................................
FAILED--no leader found
    cpan/IO-Socket-IP/t/20nonblocking-connect ..................... FAILED
at test 9
    cpan/IO-Socket-IP/t/21nonblocking-connect-internet ............ FAILED
at test 3
    cpan/IO-Socket-IP/t/30nonblocking-connect ..................... FAILED
at test 9
    cpan/IO-Socket-IP/t/31nonblocking-connect-internet ............ FAILED
at test 3

11sockopts.t passes when run by itself outside of the test suite.  The ones
ending in "connect" fail the test that looks like:

ok( !$socket->blocking, '$socket->blocking' );

Something internally is setting the blocking flag to on even though the
value passed in as an argument to IO::Socket::IP->new says to turn it off.
 That can be simplified to:

$ perl blocking.pl
Blocking? : yes

where blocking.pl looks like:

$ type blocking.pl
use strict;
use warnings;

use IO::Socket::IP;
use IO::Socket::INET;

my $testserver = IO::Socket::INET->new(
   Listen    => 1,
   LocalHost => "127.0.0.1",
   Type      => SOCK_STREAM,
) or die "Cannot listen on PF_INET - $@";

my $socket = IO::Socket::IP->new(
   PeerHost    => "127.0.0.1",
   PeerService => $testserver->sockport,
   Type        => SOCK_STREAM,
   Blocking    => 0,
);

print "Blocking? : " . ($socket->blocking ? 'yes' : 'no') . "\n";


The ones that end with "connect-internet" fail on the test that looks like:

   ok( !$socket->connected, '$socket not yet connected' );

and elsewhere as well, though the other failures may be fallout from the
first:

$ perl t/21nonblocking-connect-internet.t
ok 1 - defined $socket for cpanidx.org:80
ok 2 - $socket has fileno
not ok 3 - $socket not yet connected
#   Failed test '$socket not yet connected'
#   at t/21nonblocking-connect-internet.t line 37.
not ok 4 - ->connect eventually succeeds
#   Failed test '->connect eventually succeeds'
#   at t/21nonblocking-connect-internet.t line 50.
ok 5 - $socket now connected
ok 6 - defined $socket for cpanidx.org:6666
ok 7 - $socket has fileno
ok 8 - $socket not yet connected
not ok 9 - ->connect eventually fails with ECONNREFUSED
#   Failed test '->connect eventually fails with ECONNREFUSED'
#   at t/21nonblocking-connect-internet.t line 90.
#   dollarbang = socket is not connected
1..9
# Looks like you failed 3 tests of 9.

I believe everything that goes wrong does so somewhere
in IO::Socket::IP::_configure, but haven't really had time to dig very deep
yet.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About