请教一下,在mfc中,关于Accept函数的问题?

mfc 在主程序中使用cslisten.Accept(aa)正常,可以连接并传送消息,cslisten ,aa均为CSocket变量,
而将cslisten.Accept(aa)放在线程中编译连接不报错,运行到这里时出现Debug Assertion Failed.

BIG阳
浏览 305回答 1
1回答

白猪掌柜的

FD_CLOSE: Only valid on connection-oriented sockets (for example, SOCK_STREAM) When WSAAsyncSelect called, if socket connection has been closed. 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). 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. 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.
打开App,查看更多内容
随时随地看视频慕课网APP