1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! uTP (Micro Transport Protocol) Implementation (BEP 29)
//!
//! This module implements the uTP protocol, a UDP-based transport layer
//! designed for BitTorrent. uTP provides:
//!
//! - Reliable, ordered delivery over UDP
//! - LEDBAT congestion control (yields to other traffic)
//! - Lower latency than TCP in many network conditions
//!
//! # Architecture
//!
//! - `packet`: Packet encoding/decoding (20-byte header + extensions + payload)
//! - `congestion`: LEDBAT congestion control algorithm
//! - `state`: Connection state machine
//! - `socket`: Single uTP connection
//! - `multiplexer`: Shared UDP socket for multiple connections
//!
//! # Usage
//!
//! ```ignore
//! use gosh_dl::torrent::utp::{UtpMux, UtpConfig};
//!
//! // Create multiplexer
//! let mux = UtpMux::bind("0.0.0.0:6881".parse()?).await?;
//!
//! // Connect to peer
//! let socket = mux.connect("192.168.1.100:6881".parse()?).await?;
//!
//! // Send/receive data
//! socket.write_all(b"hello").await?;
//! let mut buf = [0u8; 1024];
//! let n = socket.read(&mut buf).await?;
//! ```
// Re-export commonly used types
pub use LedbatController;
pub use UtpMux;
pub use ;
pub use ;
pub use ;