Endpoint

data class Endpoint(val address: PeerAddress, val port: Int)

One IP endpoint (an address plus a TCP port). This is the pure-Kotlin stand-in for the tcp::endpoint values libtorrent stores in add_torrent_params::peers and banned_peers. On the wire (and in resume data) an endpoint is the address bytes in network order followed by a 16-bit big-endian port: 6 bytes for IPv4, 18 for IPv6 (see write_endpoint / read_v*_endpoint in socket_io.hpp).

Constructors

Link copied to clipboard
constructor(address: PeerAddress, port: Int)

Properties

Link copied to clipboard

the peer's IP, as a parsed PeerAddress (4- or 16-byte).

Link copied to clipboard

True if this is an IPv6 endpoint (18-byte wire form), per is_v6(endpoint).

Link copied to clipboard
val port: Int

the TCP port, 0..65535.