Skip to content

Commit

Permalink
fix: disconnect properly from the server
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Feb 29, 2020
1 parent 02d828b commit c89bb51
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Assets/Mirror/Runtime/Transport/Tcp/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ public async Task ListenAsync(int port)
// wait for a tcp client;
TcpClient tcpClient = await listener.AcceptTcpClientAsync();

// non blocking receive loop
// must be on main thread
_ = ReceiveLoop(tcpClient);
if (tcpClient.Connected)
{
// non blocking receive loop
// must be on main thread
_ = ReceiveLoop(tcpClient);
}
}
}
catch (ObjectDisposedException)
Expand Down

0 comments on commit c89bb51

Please sign in to comment.