| Crates.io | mtorrent-dht |
| lib.rs | mtorrent-dht |
| version | 0.3.3 |
| created_at | 2025-09-06 16:41:11.862917+00 |
| updated_at | 2025-09-14 14:11:36.148558+00 |
| description | Asynchronous implementation of Distributed Hash Table (DHT) for the BitTorrent protocol |
| homepage | |
| repository | https://github.com/DanglingPointer/mtorrent |
| max_upload_size | |
| id | 1827239 |
| size | 220,023 |
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));