Some more error handling on socket errors for Win32
This commit is contained in:
parent
d447b13013
commit
0192934663
@ -272,13 +272,25 @@ int RemoteConnection_recv(char* buffer, size_t length, int flags)
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
#else
|
{
|
||||||
|
int error = WSAGetLastError();
|
||||||
|
if (error == WSAEWOULDBLOCK)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
RemoteConnection_disconnect();
|
RemoteConnection_disconnect();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
RemoteConnection_disconnect();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user