develooper Front page | perl.perl5.porters | Postings from August 2001

Re: windows nt/2000 breaks non-blocking sockets

Thread Previous | Thread Next
From:
Gurusamy Sarathy
Date:
August 17, 2001 15:48
Subject:
Re: windows nt/2000 breaks non-blocking sockets
Message ID:
200108172247.f7HMljf22882@smtp3.ActiveState.com
On Fri, 17 Aug 2001 17:39:58 EDT, Rocco Caputo wrote:
>Symptom:
>
>Non-blocking connect() calls on Windows 2000/NT systems return error
>10022 (invalid argument) despite the parameters being fine.
>
>Cause:
>
>http://support.microsoft.com/support/kb/articles/Q179/9/42.ASP
>
>Synopsis:
>
>Newer versions of Windows need WSA_FLAG_OVERLAPPED to be set at the
>time sockets are created, otherwise the sockets can't be made
>non-blocking later.  Previous versions of Windows don't require the
>flag, so non-blocking sockets work there.

This is not really obvious to me.

Perl uses socket() (not WSASocket()) to create sockets on Windows.
This page claims that socket() already sets the overlapped bit:

  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/hh/winsock/ovrvw3_769e.asp

And the URL you have given above doesn't contradict that.

Can you show me a self-contained example of the perl code that works
on wNT but not on w2000?

Thanks,


Sarathy
gsar@ActiveState.com

Thread Previous | Thread Next


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