Port

data class Port(val port: Int) : PeerMessage

port (id 9, BEP-5): the sender's DHT UDP port. On the wire the port is a 16-bit big-endian value (write_dht_port emits {0,0,0,3, 9, hi, lo}).

Constructors

Link copied to clipboard
constructor(port: Int)

Properties

Link copied to clipboard
open override val id: Int

The numeric message id, or -1 for KeepAlive (which has no id byte on the wire). Matches bt_peer_connection::message_type.

Link copied to clipboard
val port: Int

Functions

Link copied to clipboard
open override fun encode(): ByteArray

The full on-the-wire frame: 4-byte big-endian length prefix + id + payload.