Griffin.Net.Channels.TcpChannel.Cleanup C# (CSharp) Method

Cleanup() public method

Cleanup everything so that the channel can be reused.
public Cleanup ( ) : void
return void
        public void Cleanup()
        {
            _encoder.Clear();
            _decoder.Clear();
            _socket = null;
            RemoteEndpoint = EmptyEndpoint.Instance;
            IsConnected = false;
            if (_sendLock.CurrentCount == 0)
                _sendLock.Release();
            if (_closeEvent.CurrentCount == 1)
                _closeEvent.Wait();
            if (Data != null)
                Data.Clear();
        }