SendResult

Result of sending a message or payload to a peer, including delivery status and error details.

Fields

ok

Whether the send was accepted by the local transport layer.

val ok: Boolean

error

Optional error string when ok is false.

val error: String?

traceId

Identifier for correlating logs and diagnostics.

val traceId: String

Example

p2p.sendMessage(peerId, payload) { result ->
    if (!result.ok) {
        log("send failed", result.traceId, result.error)
    }
}