Fix issue in ReceiveData

This commit is contained in:
Yaroslav Tretyakov authored and Ted John committed 2016-07-24 21:01:14 +01:00
1 parent 291667d5bf
commit 3116ec3e76
1 file changed
+6 -1
+6 -1
View File
@@ -369,7 +369,12 @@ public:
}
int readBytes = recv(_socket, (char *)buffer, size, 0);
if (readBytes == SOCKET_ERROR || readBytes <= 0)
if (readBytes == 0)
{
*sizeReceived = 0;
return NETWORK_READPACKET_DISCONNECTED;
}
else if (readBytes == SOCKET_ERROR)
{
*sizeReceived = 0;
if (LAST_SOCKET_ERROR() != EWOULDBLOCK && LAST_SOCKET_ERROR() != EAGAIN)