[B20.1 Win95] Problem with socket() function call.

Warren Young tangent@cyberport.com
Sun Jan 31 23:52:00 GMT 1999


At 02:07 PM 1/16/99 +0000, you wrote:
>Is there any reason that the socket() function call should return
>EINPROGRESS?

WSAEINPROGRESS (the properly decorated Winsock version of this error code)
means "a blocking call is in progress".  It's an older error code from the
Winsock 1.1 and Win16 days when blocking meant that Winsock would run a
small message pump so one blocked app would not halt the entire system.
That allowed for reentrancy in the blocked program, so subsequent Winsock
calls in that program would just tell the user to buzz off.  It appears in
your program apparently due to a stack bug; details below.

>From a casual study of the fork() code in Cygwin, it appears that they are
depending on the fact that under WinNT, socket handles are inherited by
child processes by default.  Unfortunately, a bug in Windows 95 (which you
indicate that you're running) causes this to not be true; see MS knowledge
base article Q150523 for details.  I don't know if this was fixed in
Windows 98.

I suppose Cygwin could work around this with the WSADuplicateSocket() (or
duplicate_handle() as it's wrapped internally) call, but that'd be messy
/plus ultra/.

Anyway, the fix for your program is probably to do the WSADuplicateSocket
stuff yourself or to upgrade to Windows NT.  

Sorry,

= Warren Young -- Maintainer of the Winsock Programmer's FAQ at:
= http://www.cyberport.com/~tangent/programming/winsock/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list