Core/Networking: Fix infinite loop and deadlock when closing socket.

This commit is contained in:
hondacrx
2021-02-11 12:33:05 -05:00
parent 0fd5044a71
commit 5431374491
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ namespace Framework.Networking
public void CloseSocket()
{
if (_socket == null)
if (_socket == null || !_socket.Connected)
return;
try
+3
View File
@@ -74,7 +74,10 @@ namespace Game
for (byte i = 0; i < 2; ++i)
{
if (m_Socket[i] != null)
{
m_Socket[i].CloseSocket();
m_Socket[i] = null;
}
}
// empty incoming packet queue