public void Close() { if (_issueCountFlag.Flag) return; if (_closeReason == 0) _closeReason = 1; if (_logger != null) _logger.Trace("Close connection"); if (_socket != null) _socket.Close(); if (_issueCountFlag.SetFlag()) ProcessClose(); }
protected override void PostStop() { if (_connection != null) { _connection.Close(); } if (_timeoutCanceler != null) { _timeoutCanceler.Cancel(); } base.PostStop(); }