Skip to main content

exchange

Function exchange 

Source
pub async fn exchange(
    address: &DaemonAddr,
    key: &[u8; 32],
    request: &RuntimeRequestV1,
) -> Result<RuntimeResponseV1, RuntimeExchangeError>
Expand description

Exchange one admitted request over a fresh connection to an explicit endpoint.

The caller must provision and verify the endpoint and peer independently, use a fresh capability-scoped session key, serialize sequence allocation, and retire the session on failure/reconnect. A valid MAC is not policy authorization. No default daemon socket or global HTTP token is used. All connect/write/read work shares ONE monotonic budget; even Windows connection retries are bounded. The stream is dropped on every return. The caller alone persists host receipts and decides whether to use the deterministic public fallback.