BUG: WSAEventSelect( ) Returns WSAEINVAL if Network Events is 0

Last reviewed: January 28, 1998
Article ID: Q168349
The information in this article applies to:
  • Microsoft Windows NT Workstation, version 4.0
  • Microsoft Windows NT Server, version 4.0

SYMPTOMS

When the network event's bitmask is set to 0 in the last parameter of WSAEventSelect( ), the API returns WSAEINVAL. As a consequence of this behavior, the user cannot cancel any prior association of network events with the socket.

RESOLUTION

Either of the following options will disassociate the socket from the event:

  • Call WSAEventSelect with NULL passed as the event parameter: rc = WSAEventSelect(socket, NULL, 0);

-or-
  • If your design permits, call closesocket to close the socket.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

WSAEventSelect( ) is an API that specifies an event object to be associated with the supplied set of FD_XXX network events for a given socket. This event object is set when any of the nominated network events occur.

It should have been possible to cancel the association of network events on the socket by calling

   rc = WSAEventSelect(socket, hEventObject, 0);

However, due to the above-mentioned bug, this API fails with rc=10022, which means that the supplied parameters are invalid.
Keywords          : NtwkWinsock kbbuglist
Version           : 4.0
Platform          : NT WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 28, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.