mtorrent-dht

Crates.iomtorrent-dht
lib.rsmtorrent-dht
version0.3.3
created_at2025-09-06 16:41:11.862917+00
updated_at2025-09-14 14:11:36.148558+00
descriptionAsynchronous implementation of Distributed Hash Table (DHT) for the BitTorrent protocol
homepage
repositoryhttps://github.com/DanglingPointer/mtorrent
max_upload_size
id1827239
size220,023
Mikhail Vasilyev (DanglingPointer)

documentation

README

CI Crates.io Version docs.rs

mtorrent-dht

Asynchronous implementation of Kademlia-based Distributed Hash Table (DHT) for the BitTorrent protocol. Based on Tokio and used as part of the mtorrent client.

Example usage:

use mtorrent_dht as dht;

// Create the UDP socket for DHT:
let socket = UdpSocket::bind(SocketAddrV4::new(Ipv4Addr::UNSPECIFIED, local_port)).await?;

// Set up the DHT stack:
let (outgoing_msgs_sink, incoming_msgs_source, io_driver) = dht::setup_udp(socket);
let (client, server, router) =
    dht::setup_queries(outgoing_msgs_sink, incoming_msgs_source, max_concurrent_queries);
let processor = dht::Processor::new(config_dir, client);

// Run the DHT system:
tokio::join!(io_driver.run(), router.run(), processor.run(server, cmd_receiver));
Commit count: 514

cargo fmt