Extended

data class Extended(val extId: Int, val payload: ByteArray) : PeerMessage

extended (id 20, BEP-10): the extension-protocol carrier. extId is the single-byte extended message id (0 = the extension handshake), followed by an opaque (usually bencoded) payload. On the wire: [len][20][uint8 extId][payload], len = payload.size + 2.

Constructors

Link copied to clipboard
constructor(extId: Int, payload: ByteArray)

Properties

Link copied to clipboard
val extId: Int
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

Functions

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

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String