Skip to main content

Module client

Module client 

Source
Expand description

TCP JSON-RPC client for the rpi --server endpoint.

Wire shape (one JSON object per line), spoken by rpi-package’s rpi-server extension:

-> {"jsonrpc":"2.0","id":1,"method":"start_session","params":{…}}
<- {"jsonrpc":"2.0","id":1,"result":{"sessionId":"session-1",…}}
-> {"jsonrpc":"2.0","id":2,"method":"subscribe","params":{"sessionId":"session-1"}}
<- {"jsonrpc":"2.0","id":2,"result":{"subscriptionId":7,…}}
-> {"jsonrpc":"2.0","id":3,"method":"send","params":{"sessionId":"session-1","command":{…}}}
<- {"jsonrpc":"2.0","method":"event","params":{"subscriptionId":7,"event":<child line>}}

The <child line> payloads are exactly the --mode rpc lines (crate::remote::protocol::RemoteEvent, responses, ready), so the client never needs to know how the server spawned the agent.

Structs§

RemoteClient
A connected JSON-RPC client.