RoomChannel

Constants and framing helpers for Room.channel channel views.

Reserved prefix

Every channel frame begins with CHANNEL_PREFIX (0x63, ASCII 'c' for "channel"). This value is:

  • Distinct from the admit-protocol prefix (0x61 / 'a').

  • Outside the CBOR major-type-7 range (0xe00xff) used by serialization.

  • Not emitted as the first byte of a heartbeat string (kuilt.heartbeat.… starts with 0x6b).

Applications must not emit raw payloads starting with 0x63 via Room.broadcast or Room.sendTo — that byte is reserved for channel framing. Application frames that happen to start with 0x63 will be misclassified as channel frames and routed (or silently dropped).

Wire format

[0x63][hi byte of subId][lo byte of subId][application payload …]

The 2-byte sub-id is derived from the channel name via channelSubId. Both peers compute the same sub-id independently — no registration handshake is needed. The 3-byte overhead keeps the channel-frame header small.

Properties

Link copied to clipboard
const val CHANNEL_PREFIX: Byte = 99

First byte of every channel frame.

Functions

Link copied to clipboard

Derive a 2-byte wire sub-id from a channel name.