-
Notifications
You must be signed in to change notification settings - Fork 588
Closed
Labels
Description
Module: POSIX
Description
I thought this was already reported, but apparently not. This happens on all Windows versions and all compilers/CRTs.
Steps to Reproduce
Taken from an IO::Socket::IP ticket:
use warnings;
use strict;
use POSIX 'dup2';
use Socket;
my ($testHost,$testPort)=('perl.org',443);
my $tcpProto=getprotobyname('tcp');
socket(my $sock, PF_INET6, SOCK_STREAM, $tcpProto)
or die "Could not create IPv6 socket - $!\n";
socket(my $sock2, PF_INET, SOCK_STREAM, $tcpProto)
or die "Could not create IPv4 socket - $!\n";
dup2($sock2->fileno,$sock->fileno)
or die "Unable to dup2 IPv4 socket onto IPv6 socket - $!\n";
my $iaddr=inet_aton($testHost);
my $paddr=sockaddr_in($testPort,$iaddr);
connect($sock,$paddr)
or die "Failed to connect to $testHost:$testPort - $!\n";
print "Successfully connected to $testHost:$testPort\n";
Expected behavior
It should connect successfully.