public void OnDisconnect(Channel channel) { PeerConnection peer = (PeerConnection)channel; if (this.active_peers.Contains(peer)) { if (!peer.IsActive) { Interlocked.Decrement(ref this.passive_peers_count); } else { Interlocked.Decrement(ref this.active_peers_count); } this.active_peers.Remove(peer); peer.OnDisconnect(); } }