Skip to content

v2.0.0-alpha.unstable.rev0107

Pre-release
Pre-release
Compare
Choose a tag to compare
@alanmcgovern alanmcgovern released this 10 Feb 11:13
· 757 commits to master since this release

General

  • Refactored the piece picking API to simplify the way custom picking algorithms can be implemented. IPiecePicker is responsible for tracking which blocks have been requested from each peer. IPieceRequester is responsible for determining how to prioritise piece requests, and which peer to attempt to download new blocks from.

For example the StreamingPieceRequester uses StandardPicker to prioritise pieces which are needed immediately by issuing multiple requests for blocks in those pieces, and by requesting them off peers who have high transfer rates. It then limits the number of outstanding requests for lower priority pieces so that it can react quickly if the user seeks to a new position in the stream.

Similarly, the StandardPieceRequester uses a StandardPicker to implement normal bittorrent rarest-first downloading logic. The standard requester will also automatically begin issuing duplicate requests for blocks once every block has been requested at least once.

The same StandardPicker is used by bother IPieceRequester implementations as it is flexible enough to support nearly every usecase.

  • Some small fixes around the new immutable API for setting allowed encyption types.
  • Add the necessary API to set EngineSettings.DiskCacheBytes and ensured this can be set to 0 to disable the in-memory disk cache. This is now off by default as it is still experimental.