BUG: Setting a Receive Timeout on a Raw Socket Has No EffectLast reviewed: June 2, 1997Article ID: Q169452 |
The information in this article applies to:
SYMPTOMSWhen you set a receive timeout on a raw socket, a blocking receive call posted on that socket (which is supposed to timeout if no data is received) blocks indefinitely.
STATUSMicrosoft 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 INFORMATIONThe following code segment is normally used to make a receive call timeout if no data is received within a given period of time:
SOCKET socket; int timeout = 1000; // Desired timeout in milliseconds retval = setsockopt (socket, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout));This code sets a timeout on a normal socket. If you use a raw socket instead, the API succeeds. However, as a result of the bug mentioned above, it has no influence on the behavior of the socket. To work around this problem, use the select API with a timeout value prior to posting a blocking receive call. |
Keywords : kbnetwork NtwkWinsock
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |