send

abstract suspend fun send(connectionId: NwConnectionId, bytes: ByteArray)

Send raw bytes over connectionId. Framing is the caller's responsibility.

Best-effort. An implementation MAY throw synchronously to signal an immediately-known failure (e.g. an unknown/closed connectionId) — NwSeam treats a throw as a cue to evict that connection. But a real datagram transport reports most send failures asynchronously (the link breaks after the call returns), surfacing them via connectionClosed rather than by throwing here. Callers must therefore rely on connectionClosed (the fast reason-carrying path) — backstopped by the drop-tolerant connectionStates Closed STATE — as the authoritative teardown signal, and treat a non-throwing send as "handed off", not "delivered".