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
No known key found for this signature in database
GPG Key ID: 1D7813E7FB8AA900

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;
} }