Skip to content

v2.0.0-alpha.unstable.rev0017

Pre-release
Pre-release
Compare
Choose a tag to compare
@alanmcgovern alanmcgovern released this 10 Dec 01:04
· 847 commits to master since this release

General

Changes since previous alpha:

  • EngineSettings and TorrentSettings are now immutable objects. You can use EngineSettingsBuilder and TorrentSettingsBuilder to create a new Settings object from scratch, or to create one based on an existing Settings object. Once a new immutable Settings object has been created, you must call ClientEngine.UpdateSettingsAsync or TorrentManager.UpdateSettingsAsync, as appropriate. The new settings will have been applied once the returned Task completes. If any listen ports are altered, and port forwarding is enabled, the old port will be unmapped and the new port will be mapped.

  • Dht can be enabled by setting EngineSettings.DhtPort instead of manually constructing a DhtEngine and DhtListener. The default is to enable Dht on UDP port 52193.

  • Port Forwarding can now be enabled/disabled by setting EngineSettings.AllowPortForwarding to true or false. The default is true.

  • Any EngineSetting associated with a TCP or UDP port can be set to '-1' to disable the feature, '0' to dynamically select any available port, or a specific port number to bind to. If '0' is specified and port forwarding is enabled, the dynamically bound port will be forwarded automatically.

  • Small tweak to use a low-allocation custom implementation of SemaphoreSlim built on top of ReusableTask. Reduces allocations by about 25%.

  • Improved how the PiecePicker allocates blocks from a single piece to multiple peers. The new approach is less proactive about assigning multiple peers to a single block, which in turn greatly improves the efficiency of Incremental Hashing without affecting download speeds. Recent experiments have shown that over 98% of pieces can be hashed without having to write the block to disk and read it back at a later point.

  • MonoTorrent now defaults to using a 5 megabyte memory cache for pieces which need to be written to disk. This further improves the efficiency of Incremental Hashing as blocks which are received out-of-order will be available in-memory rather than having to be read from disk.

Warning

This release contains API breaking changes in comparison to MonoTorrent 1.x series. There may be further API breakages before 2.x is finalised.