コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }