Exemplo n.º 1
0
 public override void Close()
 {
     if (!Closed)
     {
         Closed = true;
         _nextReader.Close();
     }
 }
Exemplo n.º 2
0
 public override void Close()
 {
     if (!Closed && Status != MessageProcessorStatus.Idle)
     {
         Closed = true;
         if (_queue != null)
         {
             _queue.Close();
         }
         _nextReader.Close();
     }
 }
Exemplo n.º 3
0
Arquivo: Peer.cs Projeto: wyk125/AElf
        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;
        }