Skip to main content

Module net

Module net 

Source
Expand description

TCP + bincode 传输层(多进程节点)。

Structs§

PeerOutbox
向已知 peer 发送 Raft 信封(懒连接 + 失败重试一次)。

Enums§

Inbound
入站事件:Raft 信封,或客户端请求(需异步回 ClientReply)。
WireMsg
线路消息:Raft 协议 或 客户端请求/响应。

Functions§

read_msg
run_client_request
CLI:向单个 peer 发送客户端请求并等待响应。
spawn_listener
在后台接受连接,把解码后的消息送入 inbound_tx
write_msg