BUG: Winsock--Lost FD_WRITE NotificationsLast reviewed: May 11, 1995Article ID: Q129974 |
The information in this article applies to:
SYMPTOMSIn both of the following situations, the initial FD_WRITE notifications are never received:
RESOLUTIONIn the first case, call the bind() function in addition to the socket() function as shown:
SOCKADDR_IN source_sin; source_sin.sin_family = AF_INET; source_sin.sin_addr.s_addr = htonl(INADDR_ANY); source_sin.sin_port = htons(0); s = socket(AF_INET, SOCK_DGRAM, 0); bind(s, (struct sockaddr FAR *)&source_sin,sizeof(source_sin)); WSAAsyncSelect(s, hWnd, WSA_WRITE, FD_WRITE);The window specified by hWnd in WSAAsyncSelect() will now receive the FD_WRITE notifications properly. In second case, call socket() and call connect() asynchronously as shown:
SOCKADDR_IN dest_sin; dest_sin.sin_family = AF_INET; dest_sin.sin_addr.s_addr = htonl(SERV_HOST_ADDR); dest_sin.sin_port = htons(SERVER_TCP_PORT); s = socket(AF_INET, SOCK_STREAM, 0); WSAAsyncSelect(s, hWnd, WSA_WRITE, FD_CONNECT | FD_WRITE); connect(s, (struct sockaddr FAR *)&dest_sin, sizeof(dest_sin); STATUSMicrosoft has confirmed this to be a bug in the 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 INFORMATIONIf a datagram client is not expecting to receive a response from a server, it can send data without first binding the datagram socket to a specific port. According to this behavior, a datagram socket should be able to receive FD_WRITE notifications after calling socket() and WSAAsyncSelect().
|
Additional reference words: 3.10 buglist3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |