Cancel

data class Cancel(val piece: Int, val begin: Int, val length: Int) : PeerMessage

cancel (id 8): cancel a previously sent Request. Same body as request.

Constructors

Link copied to clipboard
constructor(piece: Int, begin: Int, length: Int)

Properties

Link copied to clipboard
val begin: 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
val length: Int
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.