FD_CLOSE: Only valid on connection-oriented sockets (for example, SOCK_STREAM) a. When WSAAsyncSelect called, if socket connection has been closed. b. After remote system initiated graceful close, when no data currently available to receive (Be aware that, if data has been received and is waiting to be read when the remote system initiates a graceful close, the FD_CLOSE is not delivered until all pending data has been read). c. After local system initiates graceful close with shutdown and remote system has responded with "End of Data" notification (for example, TCP FIN), when no data currently available to receive. d. When remote system terminates connection (for example, sent TCP RST), and lParam will contain WSAECONNRESET error value. Note FD_CLOSE is not posted after closesocket is called.
d. When remote system terminates connection (for example, sent TCP RST), and lParam will contain WSAECONNRESET error value. Note FD_CLOSE is not posted after closesocket is called.
但是我又怀疑是我引起的。
我想请问一下:
当对方发来的包长度为150时,而我第一次接收了44。根据WSAAyncselect的描述,WSA会自动触发第二次的FD_READ。而此时我却没有收到FD_READ,却收到了对方的rst。
难道是我第一次没接收完,对方就rst了???
会有什么后果?
会拷贝到不需要的数据么?
比如有数据111111222222233333
你如果只想读取到3,但是你提供的buffer是32,则会读取所有的3到buffer中。
来一个包会触发一个FD_READ消息 和参数无关
我觉得太神奇了...