broadcast

abstract suspend fun broadcast(bytes: ByteArray)

Broadcast bytes to all other admitted members.

Best-effort for valid application payloads. A member the transport cannot currently reach — including, on a star, the relaying host itself — is silently skipped, and so is a payload whose encoded frame will not fit the fabric. Use the roster and the membership events to reason about who is present; do not read a returned Unit as delivery. Deliberately weaker than sendTo, which is addressed and does report.

Reserved leading bytes

The room protocol discriminates its own frames by the payload's first byte, so five values are spoken for — 0x61, 0x63, 0x65, 0x6b, 0x72, ASCII a c e k r (RoomFramePrefix). A non-terminal room refuses raw payloads classified as protocol traffic with ReservedRoomPrefix, naming the family, before any direct or relayed send. Terminal rooms retain their silent no-op behaviour.

The reservation is not uniform, because each family's real classifier differs:

ByteFamilyWhat is refused
0x61admit handshakeevery payload leading with it
0x65host electionevery payload leading with it
0x72host relayevery payload leading with it
0x63channel framingonly payloads of 3 bytes or more
0x6bliveness ping/pongonly the literal "kuilt.heartbeat.ping" / "…pong" prefixes

Empty payloads, 1- or 2-byte payloads beginning with c, and ordinary k payloads such as "keepalive" remain valid. The check uses RoomFramePrefix.classifies, matching inbound routing. Use a channel view to carry arbitrary bytes inside channel framing.

Throws

if a non-terminal room classifies bytes as protocol traffic.

Samples

room.channel("data").sendTo(peer, payload)