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

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

Thread Previous
Ron Schmidt via RT
March 4, 2018 19:38
[perl #130892] t\spec\S32-io\IO-Socket-INET.t hangs
Message ID:
>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:  I saw some documentation of the delay on msdn ( ) 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(''))
       or $! =~ /\bconnection\b.*\brefused\b/i
       or die "can't connect: $!\n";

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About