From: tangent AT cyberport DOT com (Warren Young) Subject: Re: [B20.1 Win95] Problem with socket() function call. 17 Jan 1999 23:53:53 -0800 Message-ID: <4.1.19990117172608.00a84990.cygnus.gnu-win32@mail.cyberport.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: gnu-win32 AT cygnus DOT com 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 AT cygnus DOT com" with one line of text: "help".