develooper Front page | perl.perl5.porters | Postings from July 2012

Re: io_sock.t on MSWin32

Thread Previous | Thread Next
Alex Gough
July 14, 2012 02:27
Re: io_sock.t on MSWin32
Message ID:
> > (Steve or Tony:)
> > 
> > I see two issues just messing about here:
> > 
> > 1) sometimes the ok 10 and ok 11 lines aren't output.
> > 
> > 2) sometimes the socket creation at line 385 fails.
> > 

I've been investigating a little further. The problem lies not
in ourselves, but in our libraries. Windows specifically says
that sent-but-not-transmitted or sent-locally-but-not-read
data might be discarded on socket close, as they take close() to
mean "I'm done with the resources that let this socket work":

The proper approach is to use shutdown() first, to let winsock know
we've done sending data, but still want it delivered, then to call
close, or to set appropriate SO_LINGER or SO_DONTLINGER options:

In summary, the test failures are happening because the test code is
expecting behaviour on close() which, on win32, isn't supported.
The following patch (to blead) gets the tests to always work. I have not
tried this on a unix/linux but expect it will work fine on those.

$.=bless ["Just another Perl hacker\n"]; 19800829 .. 20020829;
use overload '0+' => sub {print @{$_[0]}};

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