Check response 0 on disconnect

From recv(): The return value will be 0 when the peer has performed an orderly shutdown
This commit is contained in:
Florian Spieß
2018-08-24 19:11:30 +02:00
parent e32d001809
commit f8cc752a9a

View File

@ -118,5 +118,8 @@ bool BaseConnection::Read(void* data, size_t length)
} }
Close(); Close();
} }
else if (res == 0) {
Close();
}
return res == (int)length; return res == (int)length;
} }