ReadPieceAlert
data class ReadPieceAlert(val torrentName: String?, val pieceIndex: Int, val buffer: ByteArray? = null, val size: Int = 0, val errorMessage: String? = null) : TorrentAlert
Posted in response to read_piece() once the asynchronous read completes. Ported from libtorrent::read_piece_alert (alert_type 5). Non-discardable.
On success buffer holds the full piece payload and errorMessage is null; on failure the torrent is paused, buffer is null and errorMessage describes what went wrong. libtorrent renders <name>: read_piece <piece> successful or <name>: read_piece <piece> failed: <error>.
Constructors
Properties
Link copied to clipboard
The bitmask of AlertCategory flags this alert belongs to. Mirrors alert::category(), which returns the concrete alert's static_category.
Link copied to clipboard
the failure description, or null on success.
Link copied to clipboard
the index of the piece that was read.
Link copied to clipboard
the torrent's name, or null when the handle would be invalid (rendered as " - ", matching libtorrent).