Beispiel #1
0
        private void SetPeerBitfield(IMessageReceivedContext context, PeerConnection peer, int pieceIndex, bool available)
        {
            peer.Available.SetPieceAvailable(pieceIndex, available);

            if (!peer.IsInterestedInRemotePeer &&
                IsBitfieldInteresting(context, peer.Available))
            {
                peer.IsInterestedInRemotePeer = true;
                peer.SendMessage(new InterestedMessage());
            }
        }
Beispiel #2
0
 private void UnchokePeer(PeerConnection peer)
 {
     peer.IsChokingRemotePeer = false;
     peer.SendMessage(new UnchokeMessage());
 }