Пример #1
0
 public override void Close()
 {
     if (!Closed)
     {
         Closed = true;
         _nextReader.Close();
     }
 }
Пример #2
0
 public override void Close()
 {
     if (!Closed && Status != MessageProcessorStatus.Idle)
     {
         Closed = true;
         if (_queue != null)
         {
             _queue.Close();
         }
         _nextReader.Close();
     }
 }
Пример #3
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            _pingPongTimer?.Stop();
            _authTimer?.Stop();

            if (_messageReader != null)
            {
                _messageReader.PacketReceived -= ClientOnPacketReceived;
                _messageReader.StreamClosed   -= MessageReaderOnStreamClosed;
            }

            _messageReader?.Close();
            _messageWriter?.Close();

            _client?.Close();

            IsDisposed = true;
        }