Module outbound

Module outbound 

Expand description

Outbound command handling: turning user commands and stored session state into wire packets, gated by the server’s Receive Maximum and Maximum Packet Size.

Functions§

handle_command 🔒
Handles a single user command on a live connection.
pump_session 🔒
Drains pending subscription groups, the outbox, and pending PUBRELs onto the outbound buffer via the client’s poll_transmit, mapping its per-packet events onto the user-facing futures: a written PUBLISH reports Sent progress, every written packet (re-)arms its ack-timeout deadline, and an over-large packet fails its completion with Error::PacketTooLarge.
register_ack 🔒
Tracks a recorded SUBSCRIBE/UNSUBSCRIBE’s completion future. The caller pumps the session afterwards, which puts the group on the wire and arms its ack deadline via TransmitEvent::SubscribeSent / TransmitEvent::UnsubscribeSent. Shared tail of send_subscribe and send_unsubscribe, which differ only in how packet_id is obtained.
resubscribe_confirmed 🔒
Re-issues every confirmed subscription as a fresh SUBSCRIBE after a Session Present = 0 CONNACK so the broker re-establishes it. In-flight SUBSCRIBEs are not touched here: they are re-armed on connect and re-sent by the next session pump. Because each filter is a single entry, a filter is re-issued by exactly one path, so none goes out twice. A replay carries no user future, but it still gets a pending.acks entry tagged AckCompletion::Internal so the pump arms an ack-timeout deadline for it like any other in-flight SUBSCRIBE.
send_subscribe 🔒
send_unsubscribe 🔒