CapdProtocolCommunication

class CapdProtocolCommunication(val chain: Blockchain, convoSecret: ByteArray, var coCtxt: CoroutineContext, val name: String = "", val prefixSize: Int = 0) : ProtocolCommunication

Constructors

Link copied to clipboard
constructor(chain: Blockchain, convoSecret: ByteArray, coCtxt: CoroutineContext, name: String = "", prefixSize: Int = 0)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: CoroutineScope

Functions

Link copied to clipboard
fun finalize()
Link copied to clipboard
fun launch()
Link copied to clipboard
fun makeMessage(ba: ByteArray, tweakMsg: CapdMsg.() -> Unit): CapdMsg

Create a CAPD message but do not send it (typically for debugging)

Link copied to clipboard
open suspend override fun receive(): Pair<ByteArray, Long>

suspend fun receive(filter: ByteArray): Pair<ByteArray, Long>

Same as receive, but only returns messages whose prefix region starts with the filter (leading-bytes match so an empty filter matches all).

Link copied to clipboard
suspend fun reconnect()
Link copied to clipboard
open suspend override fun send(ba: ByteArray)
fun send(msg: CapdMsg)
suspend fun send(ba: ByteArray, msgPfx: ByteArray)

fun send(ba: ByteArray, tweakMsg: CapdMsg.() -> Unit)

Send some bytes over CAPD, allowing you to set CAPD-specific fields.

Link copied to clipboard
open suspend override fun start()
Link copied to clipboard
open override fun stop()