rama133101 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am trying to create an application that support Dual stack IP. I am using the IO::Socket::IP which allows both IPv4 and IPv6. Below is the piece of code I took from Socket::IP cpan page.
use Net::SSH2; use IO::Socket::IP; use Socket qw(:addrinfo SOCK_RAW); use Socket6; my $ipv6 = "2620:0:170:2531:60:165d:4f14:1068"; my $ipv4 = "10.243.106.8"; my $sock = IO::Socket::IP->new( PeerHost => $ipv6, PeerPort => "22", Timeout => 3 ) or die "Cannot construct socket - $@";
The above code is giving "Cannot construct socket - nodename nor servname provided" error. Initially I was using perl 5.20.2 and everything was working fine. Now,for some reason I had to move to 5.16.1 and this same piece of code is giving error.
I went through couple of posts discussing similar issues in ipv6 support. One suggestion I see is the usage of getaddrinfo. But, that doesn't help me in any way. Another post says, Socket doesn't support Ipv6. Another post suggests using socket6. I have tried all options and nothing helps
kindly provide suggestions. I believe I am missing out something in Perl 5.16.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Activeperl 5.16.1 Ipv6 support
by Apero (Scribe) on Nov 30, 2015 at 17:07 UTC | |
by rama133101 (Novice) on Dec 01, 2015 at 06:45 UTC | |
by Apero (Scribe) on Dec 01, 2015 at 13:42 UTC | |
by rama133101 (Novice) on Jan 04, 2016 at 09:25 UTC | |
by Corion (Patriarch) on Jan 04, 2016 at 09:34 UTC | |
|