Skip to main content

client_loop

Function client_loop 

Source
pub async fn client_loop(
    conn: Conn,
    handler: ClientHandler,
    rx: Receiver<OutboundEnvelope>,
) -> Result<(), NetError>
Expand description

Drive the client FSM until the peer closes or the dispatcher asks the driver to exit.

rx receives responses produced by the dispatcher; the driver writes the response bytes to the transport in the order it received them.

ยงErrors

Any transport-level error is returned. Parse errors are surfaced as NetError::Parse and end the loop after sending a synthetic error response when possible.