DarkMultiPlayer Client

DarkMultiPlayer Client

38.8k Downloads

TcpClient already disposed

JoshBlake opened this issue ยท 1 comments

commented

There is a race condition between a server disposing a client's TcpClient and the client sending additional data causing the TcpClient to sometimes be used after it is disposed.

This resulted in the client game hard locking up even though server was responsive.

[02:26:32][INFO] : New client connection from 127.0.0.1:14257
[02:26:42][INFO] : Disconnecting client Unknown, endpoint 127.0.0.1:14257, Conne
ction timed out
[02:26:42][INFO] : Connection error for client Unknown, endpoint 127.0.0.1:14257
error: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.TcpClient'.
at System.Net.Sockets.TcpClient.GetStream()
at DarkMultiPlayerServer.ClientHandler.ReceiveCallback(IAsyncResult ar) in c:
\projects\KSP\DMPdev\DarkMultiPlayer\Server\ClientHandler.cs:line 719

commented

This is a harmless error, and the disconnection handling was improved in f6e1576