Overlapped WSARecv() Callback Not Being Called in MFC App
问题 I have a COM component, implemented in C++ with ATL, that uses overlapped socket I/O. Right after the connection is made to the server, it starts an overlapped read on the socket, with code like this: // Pass pointer to this instance as hEvent parameter, for use by callback m_recvOverlapped.hEvent = reinterpret_cast<HANDLE>(this); int rc = ::WSARecv(m_s, &wsabuf, 1, &m_recvNumberOfBytes, &m_recvFlags, &m_recvOverlapped, RecvCallback); if (rc == SOCKET_ERROR) { // If error is WSA_IO_PENDING,