Have

data class Have(val piece: Int) : PeerMessage

have (id 4): the sender now has piece piece.

Constructors

Link copied to clipboard
constructor(piece: 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 piece: 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.