sendMessage

open suspend override fun sendMessage(message: ByteArray)

Sends a message to the other peer.

This should be formatted as SessionEstablishment or SessionData according to ISO/IEC 18013-5:2021.

To signal transport-specific termination send an empty message. If the transport doesn't support this, MdocTransportTerminationException is thrown.

This blocks the calling coroutine until the message is sent.

Parameters

message

the message to send.

Throws

if an unrecoverable error occurs.

if the transport doesn't support transport-specific termination.