I think it is caused by something wrong in our emulation of "blocking" accept.
bool TcpSocket::Accept(TcpSocket& ls)
{
Close();
Init();
Reset();
ASSERT(ls.IsOpen());
if(timeout) { // <<< Timeout should be Null
int h = ls.GetTimeout();
bool b = ls.Timeout(timeout).Wait(WAIT_READ, GetEndTime()); // <<< This should do the waiting until some request is available
ls.Timeout(h);
if(!b)
return false;
}
socket = accept(ls.GetSOCKET(), NULL, NULL);
if(socket == INVALID_SOCKET) {
SetSockError("accept");
return false;
}
mode = ACCEPT;
return SetupSocket();
}
Basically, error reported is EAGAIN, which is sort of "non-error", it only means that operation should be performed again later. But it should not happen anyway...
On the other way, if there is a "legal" way how it can get EAGAIN there, easy fix would be to return false for EAGAIN and timeout not Null and to loop back if timeout is Null (to be blocking).