Microsoft KB Archive/186244

{|
 * width="100%"|

FIX: Timing Crack Between FD_CONNECT and Call to Shut Down API

 * }

Q186244

-

The information in this article applies to:


 * Microsoft Windows NT Server version 4.0
 * Microsoft Windows NT Workstation version 4.0

-

SYMPTOMS
When using WSAEventSelect, a call to the shutdown API shortly after receiving a FD_CONNECT notification might fail with WSAENOTCONN.

CAUSE
There is a timing crack between receipt of a FD_CONNECT notification and a subsequent call to the shutdown API where the system reports that the socket is not connected.

RESOLUTION
Use one of the following to work around this problem:


 * Use a blocking call to the connect or WSAConnect API.
 * If you receive WSAENOTCONN when calling the shutdown API, place the call to the shutdown API in a loop with a small delay (few milliseconds).

STATUS
This problem was corrected in Windows 2000.

Additional query words:

Keywords : kbnetwork kbAPI kbOSWinNT400bug kbOSWin2000fix kbSDKPlatform kbWinsock kbGrpDSNet

Issue type : kbbug

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWinNTSsearch kbWinNTS400xsearch kbWinNTS400