Package-level declarations

Types

Link copied to clipboard
class BadFrameLengthException(val declaredLength: Long) : RuntimeException

Thrown by PeerMessage.tryReadMessage when a peer announces an unaddressable frame length.

Link copied to clipboard
class Handshake(val infoHash: Sha1Hash, val peerId: Sha1Hash, val reserved: ByteArray)

The fixed BitTorrent peer-protocol handshake. This is the pure-Kotlin port of bt_peer_connection::write_handshake() (src/bt_peer_connection.cpp) and the receive-side parsing in bt_peer_connection::on_receive/recv_handshake.

Link copied to clipboard
object MessageId

The numeric BitTorrent peer-message ids. This is a faithful copy of the bt_peer_connection::message_type enum (include/libtorrent/bt_peer_connection.hpp).

Link copied to clipboard
sealed class PeerMessage

One message of the BitTorrent peer wire protocol. This is the pure-Kotlin port of the write_* senders and on_* parsers in bt_peer_connection.cpp, plus the message id enum bt_peer_connection::message_type (include/libtorrent/bt_peer_connection.hpp).