PeerDisconnectedAlert

data class PeerDisconnectedAlert(val torrentName: String?, val endpoint: String, val client: String = "Unknown", val socketType: String = "TCP", val operation: String = "bittorrent", val errorCategory: String = "system", val errorMessage: String, val reason: Int = 0) : PeerAlert

Generated when a peer is disconnected for any reason not covered by PeerErrorAlert. Ported from libtorrent::peer_disconnected_alert (alert_type 24).

libtorrent renders <peer-prefix> disconnecting (<socketType>) [<operation>] [<errorCategory>]: <errorMessage> (reason: <reason>).

Constructors

Link copied to clipboard
constructor(torrentName: String?, endpoint: String, client: String = "Unknown", socketType: String = "TCP", operation: String = "bittorrent", errorCategory: String = "system", errorMessage: String, reason: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val category: Int

The bitmask of AlertCategory flags this alert belongs to. Mirrors alert::category(), which returns the concrete alert's static_category.

Link copied to clipboard
open override val client: String

the identified client string for the peer id, if known.

Link copied to clipboard
open override val endpoint: String

the peer's address and port, already formatted (e.g. "1.2.3.4:6881").

Link copied to clipboard

the error category name (error.category().name()).

Link copied to clipboard

the error description.

Link copied to clipboard

the operation/level where the error occurred (operation_name).

Link copied to clipboard
val reason: Int

the numeric close-reason code (close_reason_t).

Link copied to clipboard

the socket kind this peer was connected over.

Link copied to clipboard
open override val torrentName: String?

the torrent's name, or null when the handle would be invalid (rendered as " - ", matching libtorrent).

Link copied to clipboard
open override val type: Int

An integer unique to this alert type, matching the C++ alert_type static constant. It can be compared against a concrete alert's ALERT_TYPE to determine the runtime type. Mirrors alert::type().

Link copied to clipboard
open override val what: String

A short string literal naming the alert type (e.g. "torrent_finished"). It carries no bundled information. Mirrors alert::what(), which in libtorrent returns alert_name(alert_type).

Functions

Link copied to clipboard
open override fun message(): String

A string describing the alert and the information bundled with it. Intended for debugging/development, not localization. Mirrors alert::message().