Args

sealed class Args

The typed contents of a query's a dictionary, minus the always-present id. Each subtype corresponds to one BEP-5/44/51 query.

Inheritors

Types

Link copied to clipboard
class AnnouncePeer(val infoHash: Sha1Hash, val port: Int, val token: ByteArray, val impliedPort: Boolean = false, val seed: Boolean = false, val name: String? = null) : DhtMessage.Args

announce_peer {info_hash, port, token, implied_port?, seed?, n?}: BEP-5. When impliedPort is set the responder uses the UDP source port instead of port (a["implied_port"] = 1).

Link copied to clipboard
class FindNode(val target: Sha1Hash) : DhtMessage.Args

find_node {target}: BEP-5.

Link copied to clipboard
class Get(val target: Sha1Hash, val seq: Long? = null) : DhtMessage.Args

get {target, seq?}: BEP-44. seq limits the reply to newer mutable items.

Link copied to clipboard
class GetPeers(val infoHash: Sha1Hash, val noseed: Boolean = false, val scrape: Boolean = false) : DhtMessage.Args

get_peers {info_hash}: BEP-5. noseed/scrape are libtorrent's optional extension flags (a["noseed"], a["scrape"]).

Link copied to clipboard

ping: no arguments beyond id.

Link copied to clipboard
class Put(val token: ByteArray, val item: DhtItem, val cas: Long? = null) : DhtMessage.Args

put {token, v, [k, sig, seq, salt, cas]}: BEP-44. item is the value to store; DhtItem.bencodedValue is what travels as a["v"], and the mutable extras (k/sig/seq/salt) come from a MutableItem. cas is the optional compare-and-swap expected sequence number.