develooper Front page | perl.perl6.compiler | Postings from March 2018

[perl #130892] t\spec\S32-io\IO-Socket-INET.t hangs

Thread Previous
From:
Ron Schmidt via RT
Date:
March 4, 2018 19:38
Subject:
[perl #130892] t\spec\S32-io\IO-Socket-INET.t hangs
Message ID:
rt-4.0.24-13678-1520192304-569.130892-80-0@perl.org
>From your description of running the test with nmake I find it reasonable to assume you are testing on windows.  Winsock seems to have a 1 second delay for “connection refused” errors which is triggered (2000 times) by a test added with PR 227: https://github.com/perl6/roast/pull/227.  I saw some documentation of the delay on msdn (https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9b90b65c-4630-46b1-98f1-5d4d22427962/delayed-connection-refused-error?forum=netfxnetcom ) and is demonstrated by a small Perl 5 script below.  The problem also effects roast on WSL (windows subsystem for linux).

# test below runs in about 10 seconds on windows/WSL
# and instantly on linux

use Socket;     # This defines PF_INET and SOCK_STREAM

for (1..10) {
    socket my $socket,PF_INET,SOCK_STREAM,(getprotobyname('tcp'))[2];
    connect $socket, sockaddr_in(1, inet_aton('127.0.0.1'))
       or $! =~ /\bconnection\b.*\brefused\b/i
       or die "can't connect: $!\n";
    close($socket);
}


Thread Previous


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