This returns a 997 error (ERROR_IO_PENDING) on my WSARecvFrom() call. Now, I know that that a WSA_IO_PENDING is normal for an overlapped call, but I didn''t think a 997 was supposed to happen as well. Is this error harmless? Should I ignore it the same way I ignore a WSA_IO_PENDING error?
Here''s the offending code snippets...
//get a buffer for the receive port and post a read
BufferIndex = GetBuffer();
PendingReadBufferList.push_back(BufferIndex);
WinSockError = DataBuffer[BufferIndex].StartRead(&ReceiveSocket);
if (WinSockError == SOCKET_ERROR)
{
if (WSAGetLastError() != WSA_IO_PENDING)
{
[....error handling....];
}
}
int BufferClass::StartRead(SOCKET *Socket)
{
WSABUF WSABuf;
Operation = OP_READ;
ZeroMemory(&Overlapped, sizeof(WSAOVERLAPPED));
WSABuf.len = BUFFER_SIZE;
WSABuf.buf = Data;
ClientAddressSize = sizeof(sockaddr);
Flags = 0;
return WSARecvFrom(*Socket, &WSABuf, 1, &NumBytes, &Flags, (sockaddr*)&ClientAddress, &ClientAddressSize, &Overlapped, NULL);
}
Am I doing something wrong? The nature of the error suggests it may or may not be working. I''ve just never seen anyone check for the ERROR_IO_PENDING as well as WSA_IO_PENDING on a receive call.
Ron