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 Next
From:
wolfsage
Date:
April 23, 2013 16:35
Subject:
Re: [perl #116433] Get IO::Socket::IP into core for seemless v4/v6 support
Message ID:
CAJ0K8bh2-n5jU7NUrNZwoU_rojbi_aiaRqHiGYZGwVoaFs7tzw@mail.gmail.com
On Sat, Apr 6, 2013 at 10:59 AM, Ricardo Signes via RT <
perlbug-followup@perl.org> wrote:

> I fixed the two porting tests and pushed the branch to
> smoke-me/rjbs/io-socket-ip, but that failing IO test may be "everywhere."
>
> The result is not immediately useful to me:
>
>   1..26
>   ok 1
>   ok 2
>   ok 3
>   ok 4
>   ok 5
>   ok 6
>   ok 7
>   ok 8
>   ok 9
>   ok 10
>   ok 11
>   Died at ../dist/IO/t/io_sock.t line 33, <GEN5> line 2.
>
> There is a long pause between ok 11 and death.
>

I finally reproduced this and tracked it down.

Here in io_sock.t line 172 on:

# Then test UDP sockets
$server = IO::Socket->new(Domain => AF_INET,
                          Proto  => 'udp',
                          LocalAddr => 'localhost')
       || IO::Socket->new(Domain => AF_INET,
                          Proto  => 'udp',
                          LocalAddr => '127.0.0.1');
$port = $server->sockport;


The call to IO::Socket->new() is creating a handle and then blessing it to
an IO::Socket::IP object. This skips the extra arguments in
IO::Socket::INET->new() which ensure that the IO::Socket::IP object does
IPv4 and causes the server to listen on IPv6 when it shouldn't.

Currently discussing options with LeoNerd to get this moving along.

-- Matthew Horsfall (alh)

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