public override void Dispose() { this.acceptor?.Close(); this.acceptor = null; this.innArgs.Dispose(); ThreadSynchronizationContext = null; foreach (long id in this.idChannels.Keys.ToArray()) { TChannel channel = this.idChannels[id]; channel.Dispose(); } this.idChannels.Clear(); }
public override void Dispose() { if (this.IsDisposed) { return; } base.Dispose(); foreach (long id in this.idChannels.Keys.ToArray()) { TChannel channel = this.idChannels[id]; channel.Dispose(); } this.acceptor?.Close(); this.acceptor = null; this.innArgs.Dispose(); }