mfc 关于Accept函数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mfc 关于Accept函数相关的知识,希望对你有一定的参考价值。

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

参考技术A 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.
希望对你能有所帮助。

以上是关于mfc 关于Accept函数的主要内容,如果未能解决你的问题,请参考以下文章

accept函数的用法

socket 编程中 accept 函数返回

谁能告诉我accept()函数返回一个新的套接字,所谓新套接字怎么理解?

accept函数

关于socket编程获取客户端地址笔记

accept() 函数是如何工作的?