AnnounceRequest

data class AnnounceRequest(val infoHash: Sha1Hash, val peerId: PeerId, val port: Int, val uploaded: Long, val downloaded: Long, val left: Long, val event: TrackerEvent = TrackerEvent.NONE, val numWant: Int = -1, val key: Int = 0, val ip: Int = 0, val trackerId: String = "")

The parameters of a tracker announce, independent of whether it will be sent over HTTP or UDP. Mirrors the announce-relevant subset of libtorrent's tracker_request.

Constructors

Link copied to clipboard
constructor(infoHash: Sha1Hash, peerId: PeerId, port: Int, uploaded: Long, downloaded: Long, left: Long, event: TrackerEvent = TrackerEvent.NONE, numWant: Int = -1, key: Int = 0, ip: Int = 0, trackerId: String = "")

Properties

Link copied to clipboard

total bytes downloaded this session.

Link copied to clipboard

the announce event.

Link copied to clipboard

the 20-byte v1 info-hash identifying the torrent.

Link copied to clipboard
val ip: Int

the IPv4 address to advertise to the tracker, as a 32-bit value in host byte order, or 0 for "use the source address of the packet" (BEP-15 IP). libtorrent fills this from settings_pack::announce_ip; 0 is the common case.

Link copied to clipboard
val key: Int

a random per-torrent identifier the tracker uses to recognise us across IP changes (BEP-15 key, libtorrent req.key). Defaults to 0.

Link copied to clipboard
val left: Long

bytes still needed to complete (0 once we are a seed).

Link copied to clipboard

maximum peers to receive; libtorrent's num_want. The BEP-15 sentinel for "tracker's default" is -1, which is the default here.

Link copied to clipboard

our 20-byte peer id.

Link copied to clipboard
val port: Int

the TCP port we are listening on for incoming peers (listen_port).

Link copied to clipboard

the opaque &trackerid= value an HTTP tracker previously handed us in a tracker id response field, echoed back on subsequent announces (libtorrent tracker_req().trackerid). Empty means "none captured yet" and the parameter is omitted from the query. UDP trackers have no such field, so this is ignored by the UDP codec.

Link copied to clipboard

total bytes uploaded this session.