Skip to main content

Module protocol

Module protocol 

Source
Expand description

Wire protocol: frame format for Mill-RPC.

+--------+--------+-------+--------+-----------+---------+
| Magic  | Version| Flags | MsgType| PayloadLen| Payload |
| 2B     | 1B     | 1B    | 1B     | 4B (LE)   | N bytes |
+--------+--------+-------+--------+-----------+---------+

Request payload:

+------------+-----------+-----------+---------+
| RequestID  | ServiceID | MethodID  | Args    |
| 8B (LE)    | 2B (LE)   | 2B (LE)   | N bytes |
+------------+-----------+-----------+---------+

Structs§

Flags
Bit flags for frame options.
Frame
A complete frame (header + payload).
FrameHeader
Parsed frame header.

Enums§

MessageType
Message types in the wire protocol.

Constants§

HEADER_SIZE
Header size in bytes (magic:2 + version:1 + flags:1 + msg_type:1 + payload_len:4 = 9).
MAGIC
Magic bytes identifying Mill-RPC frames.
MAX_PAYLOAD_SIZE
Maximum payload size (16 MB).
VERSION
Current protocol version.

Functions§

parse_frames
Reads frames from a byte buffer. Returns parsed frames and the number of bytes consumed.