Expand description
Framing (spec: Framed self-describing messages): every message travels as a 32-bit big-endian payload length followed by exactly one CBOR item of that length.
The limit applies to the payload length. Before the handshake each side uses its own configured maximum; afterwards both use the negotiated one, the smaller of the two sides’ maxima.
Structs§
- Frame
Decoder - Splits a byte stream into frame payloads, buffering partial frames.
- Frame
TooLarge - A message whose payload is larger than the frame limit, refused by the sender.
- Oversized
- An incoming frame whose declared length exceeds the limit. Its payload is discarded, never delivered; the kind and request id come from its first bytes when they can be read.
Constants§
- DEFAULT_
MAX_ FRAME - The default maximum frame payload: 16 MiB, room for a full-resolution PNG screenshot, as agent-device’s bridge allows.
- HEADER_
LEN - Bytes in a frame header.
- MIN_
MAX_ FRAME - The smallest maximum frame payload a side may negotiate: 4 KiB, so that hellos, errors and pings always fit.
Functions§
- write_
frame - Appends
msgtooutas one frame. Refuses a payload larger thanlimit, leavingoutas it was.