Skip to main content

Module codec

Module codec 

Source
Expand description

Length-prefixed framing for byte streams: a big-endian u32 length, then the message.

Structs§

FrameDecoder
Collects bytes as they are read and hands out whole messages.

Constants§

MAX_FRAME
Largest message accepted (32 MiB): a long conversation with a few full-HD images fits, a runaway one does not. Peers before 0.5 accept 8 MiB.

Functions§

encode_frame
One framed message, ready to write.