Skip to content

Commit

Permalink
Merge branch 'mintaka' into general-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
hakusaro committed Dec 14, 2016
2 parents 564a80c + d8118f2 commit bcd00c0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion TShockAPI/Sockets/LinuxTcpSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@ void ISocket.Connect(RemoteAddress address)
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)
Expand Down

0 comments on commit bcd00c0

Please sign in to comment.