OctoTorrent.Client.IgnoringPicker.PickPiece C# (CSharp) Method

PickPiece() public method

public PickPiece ( PeerId id, BitField peerBitfield, List otherPeers, int count, int startIndex, int endIndex ) : MessageBundle
id PeerId
peerBitfield BitField
otherPeers List
count int
startIndex int
endIndex int
return OctoTorrent.Client.Messages.MessageBundle
        public override MessageBundle PickPiece(PeerId id, BitField peerBitfield, List<PeerId> otherPeers, int count, int startIndex, int endIndex)
        {
            // Invert 'bitfield' and AND it with the peers bitfield
            // Any pieces which are 'true' in the bitfield will not be downloaded
            temp.From(peerBitfield).NAnd(bitfield);
            if (temp.AllFalse)
                return null;
            return base.PickPiece(id, temp, otherPeers, count, startIndex, endIndex);
        }