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(); } } }
public void SetProcessor(PacketProcessor p) { _processor = p; p.SetSocket(this); }