private void HandleRemoteDisconnect(SocketError socketError, Exception ex) { try { _socket.Close(); IsConnected = false; _disconnectAction(this, ex ?? CreateException(socketError)); } catch (Exception exception) { ChannelFailure(this, exception); } }