/// <summary> /// Disconnects a peer from this channel /// </summary> /// <param name="pred">The predicate used to determine what peer to disconnect</param> public void DisconnectPeer(Predicate <Peer.Peer> pred) { var peer = ConnectedPeers.First(new Func <Peer.Peer, bool>(pred)); peer.Disconnect(); lock (_lockObj) ConnectedPeers.Remove(peer); }
/// <summary> /// Disconnects a peer from this channel /// </summary> /// <param name="id">The ID of the peer to disconnect</param> public void DisconnectPeer(int id) { var peer = ConnectedPeers.First(p => p.Identity.Id == id); peer.Disconnect(); lock (_lockObj) ConnectedPeers.Remove(peer); }