Esempio n. 1
0
        public virtual void Dispose()
        {
            if (Interlocked.Increment(ref _disposed) != 1)
            {
                //Only dispose once
                return;
            }

            Connection.Logger.Verbose("Disposing Connection #{0} to {1}.", GetHashCode(), EndPoint.EndpointFriendlyName);

            _idleTimer.Dispose();
            _tcpSocket.Dispose();
            var readStream = Interlocked.Exchange(ref _readStream, null);

            if (readStream != null)
            {
                readStream.Dispose();
            }
        }
Esempio n. 2
0
 public void Dispose()
 {
     socket?.Dispose();
 }