Interface IPieceRequester
Allows an IPiecePicker implementation to create piece requests for specific peers and then add them to the peers message queue. If the limits on maximum concurrent piece requests are ignored
Namespace: MonoTorrent.Client.PiecePicking
Assembly: MonoTorrent.dll
Syntax
public interface IPieceRequester
Properties
InEndgameMode
Should return true if the underlying piece picking algorithm has entered 'endgame mode' as defined by the bittorrent specification.
Declaration
bool InEndgameMode { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Picker
The underlying IPiecePicker used to create piece requests and validate piece messages when they are received.
Declaration
IPiecePicker Picker { get; }
Property Value
| Type | Description |
|---|---|
| IPiecePicker |
Methods
AddRequests(IPeerWithMessaging, IReadOnlyList<IPeerWithMessaging>)
Attempts to enqueue more requests for the specified peer.
Declaration
void AddRequests(IPeerWithMessaging peer, IReadOnlyList<IPeerWithMessaging> peers)
Parameters
| Type | Name | Description |
|---|---|---|
| IPeerWithMessaging | peer | |
| System.Collections.Generic.IReadOnlyList<IPeerWithMessaging> | peers |
AddRequests(IReadOnlyList<IPeerWithMessaging>)
Should enqueue piece requests for any peer who is has capacity.
Declaration
void AddRequests(IReadOnlyList<IPeerWithMessaging> peers)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IReadOnlyList<IPeerWithMessaging> | peers |
Initialise(ITorrentData, IReadOnlyList<BitField>)
Declaration
void Initialise(ITorrentData torrentData, IReadOnlyList<BitField> ignorableBitfields)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentData | torrentData | The files, size and piecelength for the torrent. |
| System.Collections.Generic.IReadOnlyList<BitField> | ignorableBitfields | These bitfields represent pieces which have successfully
downloaded and passed a hash check, pieces which have successfully downloaded but have not hash checked yet or
pieces which have not yet been hash checked by the library and so it is not known whether they should be requested or not.
After creating an IPiecePicker, you should call
Wrap(IPiecePicker, IEnumerable<BitField>) passing the IPiecePicker
you created and the |