Netorrent 0.0.3
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Netorrent --version 0.0.3
NuGet\Install-Package Netorrent -Version 0.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Netorrent" Version="0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Netorrent" Version="0.0.3" />
<PackageReference Include="Netorrent" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Netorrent --version 0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Netorrent, 0.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Netorrent@0.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Netorrent&version=0.0.3
#tool nuget:?package=Netorrent&version=0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Netorrent
A async-first .NET 10.0 BitTorrent client library for downloading and seeding torrents.
Installation
Stable Release
dotnet add package Netorrent
Requirements:
- .NET 10.0 or higher
Quick Start
using Netorrent.TorrentFile;
await using var client = new TorrentClient();
await using var torrent = await client.LoadTorrentAsync(
"path/to/file.torrent",
"output/directory"
);
await torrent.CheckAsync(); // Verify existing data
await torrent.StartAsync(); // Start downloading
await torrent.Completion; // Wait for completion
Usage Examples
Statistics Monitoring
using Netorrent.TorrentFile;
await using var client = new TorrentClient();
await using var torrent = await client.LoadTorrentAsync("file.torrent", "output");
await torrent.StartAsync();
var completionTask = torrent.Completion.AsTask();
// Monitor detailed statistics
while (!completionTask.IsCompleted)
{
var data = torrent.Statistics.Data;
var peers = torrent.Statistics.Peers;
var check = torrent.Statistics.Check;
Console.WriteLine($"Progress: {(double)data.Verified.Bytes / data.Total.Bytes:P1}");
Console.WriteLine($"Download speed: {data.DownloadSpeed.BytesPerSecond} B/s");
Console.WriteLine($"Upload speed: {data.UploadSpeed.BytesPerSecond} B/s");
Console.WriteLine($"Connected peers: {peers.ConnectedCount}");
Console.WriteLine($"Pieces checked: {check.CheckedPiecesCount} / {check.TotalPiecesCount}");
await Task.Delay(1000);
}
await completionTask;
Advanced Configuration
using Microsoft.Extensions.Logging;
using Netorrent.TorrentFile;
var logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger<Netorrent.TorrentFile.TorrentClient>();
await using var client = new TorrentClient(options => options with
{
Logger = logger,
UsedAdressProtocol = UsedAddressProtocol.Ipv4,
UsedTrackers = UsedTrackers.Http | UsedTrackers.Udp
});
await using var torrent = await client.LoadTorrentAsync("file.torrent", "output");
await torrent.CheckAsync();
await torrent.StartAsync();
await torrent.Completion;
Torrent Creation
using Netorrent.TorrentFile;
await using var client = new TorrentClient();
// Create torrent from single file
var torrent = await client.CreateTorrentAsync(
"path/to/file.txt",
"http://tracker.example.com/announce"
);
// Create torrent from directory with multiple trackers
var torrent = await client.CreateTorrentAsync(
"path/to/directory",
"http://main.tracker.com/announce",
announceUrls: [["http://main.tracker.com/announce"], ["http://backup.tracker.com/announce"]],
pieceLength: 512 * 1024 // 512KB pieces
);
Stopping and Canceling Torrents
using Netorrent.TorrentFile;
await using var client = new TorrentClient();
await using var torrent = await client.LoadTorrentAsync("file.torrent", "output");
await torrent.StartAsync();
// Request a stop (doesn't wait for ongoing operations to finish)
torrent.Stop();
Console.WriteLine("Stop requested");
// Or stop gracefully (waits for current operations to complete)
await torrent.StopAsync();
Console.WriteLine("Torrent stopped gracefully");
BEP Implementation
Netorrent implements the following BitTorrent Enhancement Proposals (BEPs):
- BEP 3: The BitTorrent Protocol Specification - Core BitTorrent protocol specification including metainfo files, tracker communication, and peer wire protocol
- BEP 7: IPv6 Tracker Extension - IPv6 support for tracker communication and compact peer list handling
- BEP 12: Multitracker Metadata Extension - Support for multiple tracker tiers and backup tracker fallback
- BEP 15: UDP Tracker Protocol - UDP-based tracker protocol for reduced overhead and improved performance
- BEP 23: Tracker Returns Compact Peer Lists - Compact peer list format to reduce tracker response size and improve efficiency
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- R3 (>= 1.3.0)
- ZLinq (>= 1.5.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.4-nightly-1777574578-1f... | 113 | 4/30/2026 |
| 0.0.4-nightly-1777574394-fe... | 101 | 4/30/2026 |
| 0.0.4-nightly-1777574199-55... | 95 | 4/30/2026 |
| 0.0.4-nightly-1777574014-9c... | 97 | 4/30/2026 |
| 0.0.4-nightly-1775671857-06... | 113 | 4/8/2026 |
| 0.0.4-nightly-1775391363-6d... | 110 | 4/5/2026 |
| 0.0.4-nightly-1775391302-6f... | 108 | 4/5/2026 |
| 0.0.4-nightly-1775390975-ff... | 116 | 4/5/2026 |
| 0.0.4-nightly-1775390954-4a... | 113 | 4/5/2026 |
| 0.0.4-nightly-1775390932-60... | 104 | 4/5/2026 |
| 0.0.4-nightly-1775390920-a7... | 102 | 4/5/2026 |
| 0.0.4-nightly-1775381901-1e... | 106 | 4/5/2026 |
| 0.0.4-nightly-1775331149-32... | 103 | 4/4/2026 |
| 0.0.4-nightly-1775328965-4c... | 105 | 4/4/2026 |
| 0.0.4-nightly-1774730043-62... | 156 | 3/28/2026 |
| 0.0.4-nightly-1772658078-44... | 112 | 3/4/2026 |
| 0.0.4-nightly-1772399652-77... | 125 | 3/1/2026 |
| 0.0.3 | 136 | 2/27/2026 |
| 0.0.3-nightly-1772224782-26... | 115 | 2/27/2026 |
| 0.0.3-nightly-1772223287-d4... | 121 | 2/27/2026 |
Loading failed