Skip to content

Commit

Permalink
improve the internal close
Browse files Browse the repository at this point in the history
  • Loading branch information
gaochundong committed May 31, 2017
1 parent e1d09b4 commit 07feb51
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Cowboy/Cowboy.Sockets/Tcp/Client/APM/TcpSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ private void HandleTcpServerConnected()
Close(true); // user side handle tcp connection error occurred
}
}
catch (TimeoutException ex)
{
_log.Error(ex.Message, ex);
Close(false); // timeout exception
throw;
}
catch (Exception ex)
{
_log.Error(ex.Message, ex);
Expand Down Expand Up @@ -374,7 +380,7 @@ private void HandleDataReceived(IAsyncResult ar)
if (this.State != TcpSocketConnectionState.Connected
|| _stream == null)
{
Close(false);
Close(false); // receive buffer callback
return;
}

Expand Down

0 comments on commit 07feb51

Please sign in to comment.