This commit is contained in:
Bluzume 2021-11-05 05:41:29 -04:00
parent 452a8ad60f
commit b75121b54f

View file

@ -124,7 +124,16 @@ namespace HISP.Server
do do
{ {
// HI1 Packets are terminates by 0x00 so we have to read until we receive that terminator // HI1 Packets are terminates by 0x00 so we have to read until we receive that terminator
ClientSocket.Poll(0, SelectMode.SelectRead);
if (isDisconnecting || ClientSocket == null)
return;
if(ClientSocket.Poll(0, SelectMode.SelectRead))
{
Disconnect();
return;
}
if (!ClientSocket.Connected) if (!ClientSocket.Connected)
{ {
Disconnect(); Disconnect();
@ -153,7 +162,7 @@ namespace HISP.Server
} }
} }
if (isDisconnecting) if (isDisconnecting || ClientSocket == null)
return; return;