Catch and log on linux socket read
This commit is contained in:
parent
8e411b0db9
commit
00b3ac59f4
1 changed files with 14 additions and 1 deletions
|
|
@ -73,7 +73,20 @@ namespace TShockAPI.Sockets
|
|||
private void ReadCallback(IAsyncResult result)
|
||||
{
|
||||
Tuple<SocketReceiveCallback, object> tuple = (Tuple<SocketReceiveCallback, object>)result.AsyncState;
|
||||
tuple.Item1(tuple.Item2, this._connection.GetStream().EndRead(result));
|
||||
|
||||
try
|
||||
{
|
||||
tuple.Item1(tuple.Item2, this._connection.GetStream().EndRead(result));
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// This is common behaviour during client disconnects
|
||||
((ISocket)this).Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TShock.Log.Error(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void SendCallback(IAsyncResult result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue