NodeEntry
One node in the DHT routing table: the pure-Kotlin port of libtorrent's node_entry (include/libtorrent/kademlia/node_entry.hpp, src/kademlia/node_entry.cpp).
libtorrent stores the endpoint as a union_endpoint (a Boost.Asio address+port). KiteTorrent's commonMain has no socket types, so per the DHT module's contract the endpoint is carried as a host String plus an Int. The host is additionally parsed once into a PeerAddress (addr) so the routing table can do the things that genuinely need the numeric address: the BEP 42 verified check and per-IP de-duplication.
Counters & flags (ported verbatim):
rtt: the smoothed round-trip time in milliseconds;
0xffffmeans "unknown". updateRtt applies libtorrent'srtt*2/3 + new/3EWMA.timeoutCount: consecutive failed requests. The sentinel
0xffmeans "never pinged" (see pinged);0means "confirmed up" (see confirmed).verified: the node id matches its IP per BEP 42 (verifyId). The "which node is better" ordering (isBetterThan) uses it as the primary key.
This is a mutable value object (libtorrent mutates entries in place inside the buckets), so it is a plain class with var fields rather than a data class.
Constructors
Properties
Smoothed round-trip time in ms; 0xffff (= RTT_UNKNOWN) means unknown.
Consecutive failures. 0xff (= NOT_PINGED) is the special "we have not pinged this node yet" sentinel; otherwise it counts timeouts in a row.