DhtEndpoint
A network endpoint (address + UDP/TCP port) as it appears inside DHT messages: the pure-Kotlin stand-in for the udp::endpoint / tcp::endpoint that libtorrent serialises with aux::write_endpoint / aux::read_v4_endpoint (include/libtorrent/socket_io.hpp).
libtorrent's compact endpoint form is the address in network byte order (4 bytes for IPv4, 16 for IPv6) immediately followed by the 16-bit port, big-endian. That is exactly 6 bytes for v4 and 18 for v6. See encode / decodeV4 / decodeV6.
KiteTorrent has no socket types in commonMain, and PeerAddress exposes only parseOrNull (no raw-bytes constructor), so this type owns the raw address bytes itself. toPeerAddress bridges to PeerAddress when the richer predicates (locality, ordering) are needed.
Properties
Functions
The address rendered as an IPv4 dotted-quad or IPv6 colon-hex literal.
Append this endpoint's compact form (address bytes then big-endian port) to out: a port of aux::write_endpoint.
The address as a PeerAddress (via its dotted-quad / colon-hex literal), or null if the bytes don't round-trip through PeerAddress.parseOrNull (should never happen for well-formed 4/16-byte addresses).