Package-level declarations
Types
Per-URL announce bookkeeping. This is the KiteTorrent port of the live state libtorrent carries in aux::announce_entry and aux::announce_infohash (include/libtorrent/aux_/announce_entry.hpp). The session module owns the announce loop and tier logic; this struct is the mutable state it threads per tracker URL so the loop can decide when to (re-)announce and what to send.
The parameters of a tracker announce, independent of whether it will be sent over HTTP or UDP. Mirrors the announce-relevant subset of libtorrent's tracker_request.
A tracker's response to an announce. This is the announce-relevant subset of libtorrent's tracker_response.
HTTP(S) tracker client, the network half of libtorrent's http_tracker_connection. All the protocol logic (building the announce URL with percent-encoded binary info-hash/peer-id, parsing the bencoded response incl. BEP-23 compact peers) lives in the pure, tested HttpTrackerCodec; this class is just the ktor-client GET around it.
A single peer endpoint returned by a tracker: an IP address (in dotted-quad or colon-hex string form) and a TCP port. This is the flattened equivalent of libtorrent's ipv4_peer_entry / ipv6_peer_entry (peer.hpp); KiteTorrent's peer layer keeps addresses as host strings (see peer.PeerAddress), so the compact 6-byte (v4) / 18-byte (v6) tracker encodings are decoded into strings here.
A tracker's response to a scrape: the per-info-hash swarm statistics. It ports the arguments libtorrent passes to request_callback::tracker_scrape_response (complete, incomplete, downloaded, downloaders).
The exponential failure back-off libtorrent applies between failed announces, ported from announce_infohash::failed (src/announce_entry.cpp). Exposed as a pure helper so the session's announce loop can compute the next-announce instant without duplicating the formula. The loop owns when to call it; this just does the arithmetic.
The announce event, porting libtorrent's enum class event_t (tracker_manager.hpp).
Thrown when a tracker returns a failure reason member (BEP-3), the typed counterpart of libtorrent setting resp.failure_reason and raising the errors::tracker_failure code. Carries both the human-readable reason text the tracker sent and the corresponding error code (LibtorrentError.TRACKER_FAILURE), so a caller can surface the message or branch on the code uniformly with the plain TorrentExceptions this codec also throws.
The per-torrent &key= value libtorrent threads into every announce (torrent::tracker_key()), a stable 32-bit identifier the tracker uses to recognise us across IP changes. libtorrent derives it deterministically from object addresses; that is impossible (and pointless) on KMP, so we generate a random 32-bit value once per torrent and reuse it. The wire semantics are identical: the same opaque key travels on every announce for this torrent. The old default of 0 is replaced by generate.
A BEP-15 UDP tracker client: the live half of libtorrent's udp_tracker_connection (src/udp_tracker_connection.cpp), driven over the proven UdpSocket. The fixed-layout packet build/parse lives in UdpTrackerCodec; this class owns the transaction: the mandatory two-step connect→announce handshake, the random transaction ids, connection-id caching, and the "ignore datagrams that aren't ours" filtering.