March Docs

NetFrame

NetFrame: length-prefixed framing for the distributed net-kernel transport.

A frame is a 4-byte big-endian length header followed by exactly that many payload bytes. Bytes are represented as List(Int) (each 0..255), matching Msgpack.encode's output, so a framed MessagePack value is NetFrame.encode(Msgpack.encode(value)).

decode pulls one complete frame off the front of a (possibly partial) buffer, returning the payload and the unconsumed remainder; None means "need more bytes" (the header or body has not fully arrived yet).

Functions

fndecodedecode(buf : List(Int)) : Option((List(Int), List(Int)))#
fnencodeencode(payload : List(Int)) : List(Int)#