Releases: alanmcgovern/monotorrent
v2.0.1
General
- Bugfix: Some overloads of
ClientEngine.AddStreamingAsync
broke the ability to save/restore the engine state usingClientEngine.SaveStateAsync
andClientEngine.RestoreStateSAync
. A common symptom of this was aFileNotFound
exception duringRestoreStateAsync
. This has been resolved.
v2.0.0
General
This is the first stable release of the 2.0 series. There are far too many changes between 1.x and 2.0 to list, but suffice it to say there have been numerous bug fixes and performance improvements across the board. In particular, there have been substantial improvements to the Streaming mode.
If you were using StreamProvider
in past releases, the new approach is to use ClientEngine.AddStreamingAsync
which will return a TorrentManager
configured for streaming. Once you start the download you can create a stream to any of the files in the torrent using TorrentManager.StreamProvider
, just like before.
MonoTorrent now uses an in-memory cache by default, which reduces the number of disk operations substantially. This feature works in tandem with incremental hashing, which means that even if some blocks in a given piece arrive out-of-order, it is still possible to hash all blocks before writing them to disk, eliminating the need to re-read them later.
Finally, the last big features are around how state is saved/restored. FastResume
data for a torrent will, by default, be saved every 20-30 seconds. In the event of a crash you will be able to resume the torrent without having to run a complete hash check. This can be controlled by EngineSettings.FastResumeMode
if you want to use one of the other behaviours. Additionally, you can serialize a ClientEngine
to disk, and restore it, using ClientEngine.SaveStateAsync
and the static method ClientEngine.RestoreStateAsync
. This should be invoked just before your application closes, or whenever is appropriate. It will flush a fresh copy of fast resume data to disk for all loaded torrent, as well as capturing all mutable state in a TorrentManager
so it can be restored later. For example, ITorrentFile.Priority
will be maintained, and so will the paths where files are stored if you have used TorrentManager.MoveFileAsync
.
v2.0.0-alpha.unstable.rev0193
General
- Small tweak to IStreamingPieceRequester to ensure that it downloads pieces from before the high priority set, if all other data has been requested. What this means is that if, for example, you seek to the middle of a file, the engine will prioritise downloading the second half of the file completely, and then will begin downloading pieces from the first half.
v2.0.0-alpha.unstable.rev0192
General
- Small performance improvements to some Bitfield methods
BitField
is now immutable. If you need a mutable version use aMutableBitfield.ctor(BitField)
, orMutableBitfield.From (BitField)
to create a mutable version of a bitfield. This is useful for custom piece pickers.- Optimised how partial download progress (the amount of data which will be downloaded after excluding files marked as DoNotDownload) is calculated.
- Small change to how pieces are requested from a peer. Additional requests are batched when the number of pieces being requested gets larger.
- Removed a confusing parameter from IPieceRequester. There was no need to include a BitField in the parameters as it wasn't used for anything meaningful.
- ITorrentFile.Priority is now a readonly property publicly. If you want to change the priority for a file you should call
TorrentManager.SetFilePriorityAsync (TorrentFile, Priority)
. This is a threadsafe way to update the priority, and allows internal state to be updated immediately, rather than having to continually poll for changes. - Small perf improvement when bootstrapping the DHT table from a list of cached nodes.
- Fixed a cosmetic bug where mapping a PieceIndex to the corresponding ITorrentFile could return the wrong File in some scenarios. The impact was that the first or last piece for a given file may never be set to true, so the progress reported by
ITorrentFileInfo.BitField
would be < 100% even after the torrent entered Seeding mode after downloading all data. - Fix submitted by @phil-scott-78 to ensure web seeds with invalid Uris are gracefully discarded.
v2.0.0-alpha.unstable.rev0167
General
-
The in-memory disk cache is now enabled by default. Blocks which are received from other peers will be cached in-memory until they are hashed. This reduces the need to write a block to disk and then read it back in order to determine whether a block has been successfully received.
-
EngineSettings.ListenPort
andEngineSettings.DhtPort
are now random by default. -
Fixed a bug where ports may not be automatically forwarded as expected, depending on when
EngineSettings.AllowPortForwarding
is enabled. -
Patch from @SICGames to support cross origin resource sharing when using
StreamProvider.CreateHttpAsync
to stream data via HTTP. -
Removed some APIs previously marked as
[Obsolete]
.
v2.0.0-alpha.unstable.rev0147
General
-
Some minor renaming of settings in
EngineSettings
andEngineSettingsBuilder
. The old setting still exist but have been marked as[Obsolete]
and will be removed in a future pre-release. -
EngineSettings.CreateContainingDirectory
has been added. This setting only affects multi-file torrents. If a multi file torrent is being downloaded and this setting is enabled, a containing directory will automatically be created. If this is set to false, then no containing directly will be created for the files. -
If a
MagnetLink
is used to download a torrent you can now useTorrentManager.WaitForMetadataAsync ()
to wait for the metadata to be available. Metadata downloaded in this way may be automatically persisted in theEngineSettings.MetadataCacheDirectory
so it can be reloaded immediately if the MagnetLink is used a second time. -
There has been a fairly large change in how torrents are added to the engine, or are registered for streaming. The old API required you to create a
TorrentManager
manually and then register it with aClientEngine
before it could be used. This API has been simplified into:
var engine = new ClientEngine ();
// Download a torrent normally. `TorrentManager.StreamProvider` will be null
// and you will not be able to stream files as they download
TorrentManager downloader = await engine.AddAsync (...);
// Download a torrent in so that individual files can be streamed as they download
// `TorrentManager.StreamProvider` will be non-null and you will be able to stream
// files as they download using `TorrentManager.StreamProvider.CreateStreamAsync`.
TorrentManager streaming = await engine.AddStreamingAsync (...);
```
NOTE: If you download a torrent using a `MagnetLink` the engine will check for, and load, a cached version of the metadata if one is discovered in the cache directory.
* The engine will now automatically save/restore `FastResume` data for individual torrents
and will also save/restore a cache of the DHT table reduce the time it takes to bootstrap
DHT. These behaviours are on by default, but can be disabled using the settings in `EngineSettings`.
v2.0.0-alpha.unstable.rev0132
General
- Added a
CreateSubFolder
property toTorrentSettings
to control whether or not a top level containing directory is created for multi-file torrents. - Several improvements to the in memory disk cache. If blocks arrive out of order they can now be incrementally hashed using data stored in the in-memory cache, as long as the data has not been flushed to disk.
v2.0.0-alpha.unstable.rev0123
General
- Fixes an issue in the prior 2 releases which causes torrents with piece sizes which are not integer multiples of 16kB to fail to download correctly.
v2.0.0-alpha.unstable.rev0122
General
- Several improvements to how the memory cache interacts with incremental hashing. The memory cache is still off by default, but it can be enabled using
EngineSettingsBuilder
.
v1.0.29
General
- Fixes an issue where StreamProvider would sometimes successfully download the metadata for a torrent when using a magnet link, but would not actually download the data for the torrent. A workaround for this issue is to stop and start the torrent after the metadata has been downloaded.
- Fixes an issue where StreamProvider could mishandle files larger than 2GB.