Local daemon control channel for MoonBit: length-prefixed frames, token auth over loopback TCP, contact files in the state dir
Dependencies
| 接口 Interface | 说明 Description |
|---|---|
| generate_token() | 内核 RNG 256-bit;256 bits from the kernel RNG |
| dial(state_dir) | 按 port 文件连接;Connect via the port file |
| accept_authed(server, token) | 接受并认证;Accept + authenticate |
| round_trip_bytes(conn, token, payload, timeout_ms) | 认证往返;Authenticated round trip |
| read_frame_timeout(conn, timeout_ms) | 读一帧(静默容错);Read one frame, silence-tolerant |
| read_token / read_daemon_port | 接触文件;Contact files |
pub suberror IpcError {
Timeout
AuthFailed
Closed(String)
TooLarge(size~ : Int, limit~ : Int)
} derive(Debug)let AUTH_TIMEOUT_MS : Intlet MAX_MSG_BYTES : Intlet PORT_FILE : Stringfn generate_token() -> String raisefn read_daemon_port(state_dir : String) -> Int?fn read_token(state_dir : String) -> String?Install
Download zipLocal daemon control channel for MoonBit: length-prefixed frames, token auth over loopback TCP, contact files in the state dir
Dependencies