Exemple #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                _sock.Dispose();
                _sock      = null;
                _processor = null;

                if (CurrentSession != null)
                {
                    CurrentSession.OnSocketDisconnect();
                    CurrentSession = null;
                }

                if (_packetObserverHandle != null)
                {
                    _packetObserverHandle.UnsubscribeAsync().Wait();
                }
                if (_commandObserverHandle != null)
                {
                    _commandObserverHandle.UnsubscribeAsync().Wait();
                }
            }
        }
Exemple #2
0
 public void SetProcessor(PacketProcessor p)
 {
     _processor = p;
     p.SetSocket(this);
 }