调用listen(m_socket,5);函数出现的问题
lastcode=WSAGetLastError();
wsprintf(szOut, "szout=%ld ", lastcode);
MessageBox(szOut);
用WSAGetLastError();取得最后的代码 10045
The attempted operation is not supported for the type of object referenced.
由于参考对象的类型,试图尝试的操作不被支持
Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket.
通常出现这种情况是当套接口到套接口不能支持这种试图在数据包接口连接的操作
[解决办法]
意思是说,如果数据报协议不支持监听,如果你使用的是UDP,是不支持listen和accept的。