send

suspend fun send(data: ByteArray)

Sends transport bytes as messages of at most 1316 bytes, applying native backpressure. Concurrent calls retain their chunk ordering. Do not mutate data until return. Success means libsrt accepted the bytes, not that the peer has consumed them. Cancelling an active send closes the connection; cancelling a queued sender leaves the active sender intact. Empty arrays produce no messages.

Parameters

data

Transport payload; MPEG-TS framing is the caller's responsibility.

Throws

If the connection is not open.

If the peer disconnects or a native send fails.

CancellationException

If the calling coroutine is cancelled.