Please, someone kindly help me how to catch socket operation's error from CAsyncSocket Class.
If I do this:
int iLen = recv(socket, socketBuffer, sizeBuffer, 0);
if(iLen==SOCKET_ERROR) {
//handle error here
} else {
//do something with the received data
}
It always returns error, which is WSAEWOULDBLOCK
, and the same for other operation like send(), connect(), etc...
According to MSDN, it's not a fatal error, and some time must elapse for the actions to be finished.
So how can I actually check every time my program did recv() or send() correctly?