accept

suspend fun accept(raw: ByteStream, infoHash: Sha1Hash, rng: Random = Random.Default, allowedEncLevel: Int = ALLOW_BOTH, preferRc4: Boolean = true): ByteStream

Passive open for a single torrent infoHash. Returns the negotiated transport. Throws MseException if the obfuscated SKEY doesn't match or verification fails.


suspend fun accept(raw: ByteStream, infoHashes: List<Sha1Hash>, rng: Random = Random.Default, allowedEncLevel: Int = ALLOW_BOTH, preferRc4: Boolean = false): Pair<ByteStream, Sha1Hash>

Passive open (we accepted a connection that began with a DH key rather than the plaintext BitTorrent handshake): run the MSE handshake as the receiver, resolving which torrent the peer wants from the obfuscated SKEY against infoHashes. Returns the negotiated transport plus the matched info-hash. Throws MseException if no candidate matches or verification fails.