Skip to main content

Module wire

Module wire 

Source
Expand description

Backend-side wire handling for broker handoff offers (#354, slice 6).

Given a framed connection to the broker (the same v1 local-socket framing used by every other broker connection), this module:

  1. reads one HandoffOffer frame (read_handoff_offer),
  2. validates and consumes the presented one-time token through the existing accept_handed_off path, and
  3. replies with a HandoffAck frame echoing the token and correlation id (respond_to_handoff_offer).

serve_handoff_offer composes all three for the common case. A rejected token still produces a well-formed HandoffAck with accepted = false and the rejection detail, so the broker can fall back to the reconnect path immediately instead of waiting out its ACK deadline.

Enums§

BackendHandoffWireError
Errors surfaced while reading or answering a handoff offer frame.

Functions§

read_handoff_offer
Read and validate one broker→backend HandoffOffer frame.
respond_to_handoff_offer
Validate/consume one received offer and write the matching HandoffAck.
serve_handoff_offer
Read one offer, validate/consume the token, and reply with the ACK.
write_handoff_ack
Write one backend→broker HandoffAck frame.