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
47
48
49
50
51
//! UDP tracker protocol implementation (BEP 15).
//!
//! This module implements the UDP tracker protocol as specified in:
//! - BEP 15: UDP Tracker Protocol
//! - BEP 41: UDP Tracker Protocol Extensions
//!
//! # Protocol Overview
//!
//! The UDP tracker protocol uses a connection-oriented approach:
//! 1. Client sends a connect request
//! 2. Server responds with a connection ID
//! 3. Client uses connection ID for announce/scrape requests
//!
//! # Message Types
//!
//! - **Connect** (action=0): Establish connection, get connection ID
//! - **Announce** (action=1): Register peer, get peer list
//! - **Scrape** (action=2): Query torrent statistics
//! - **Error** (action=3): Error response
//!
//! # Features
//!
//! - High-performance async UDP handling
//! - Connection ID caching
//! - IPv4 and IPv6 support (BEP 7)
//! - Proxy Protocol v2 (SPP) support for load balancers
//! - Configurable socket buffer sizes
//! - Multi-threaded packet parsing
//!
//! # Performance
//!
//! UDP is more efficient than HTTP for high-traffic trackers:
//! - Lower overhead (no HTTP headers)
//! - Faster connection establishment
//! - Better suited for millions of announces per second
/// Enumerations for UDP protocol actions and errors.
/// Implementation blocks for UDP packet handling.
/// Data structures for UDP protocol messages.
/// Traits for UDP request/response parsing.
/// Core UDP service implementation.