nquic_protocol_send_queues (nquic v1.0.0)
View SourcePer-encryption-level pending-frame queues and their flush drains.
Pure functions over #conn_state{} that buffer outbound frames into
three per-space queues (Initial / Handshake / 1-RTT), coalesce them,
and drain each queue into one or more encrypted packets via the packet
builders in nquic_protocol_send. The dependency is one-way: this
module calls down into nquic_protocol_send (builders, MTU batching,
send context) module-qualified, and into nquic_protocol_ack to
piggyback a pending ACK before an application flush. nquic_protocol
drives the flush; the queue functions are called from across the
protocol family whenever a control or stream frame is produced.
Summary
Functions
Queue a frame for a Handshake-space packet. Drained by flush/1 into a
Handshake-coalesced packet at the next flush. Used for retransmits of
Handshake CRYPTO and PTO probes between Initial and Established.
Queue a frame for an Initial-space packet. Drained by flush/1 into an
Initial-coalesced packet at the next flush. Used for retransmits of
client/server Initial CRYPTO and PTO probes during the handshake.
Functions
-spec build_app_or_zero_rtt([nquic_protocol_send:pre_encoded()], integer(), nquic_protocol:state()) -> {ok, iodata(), nquic_protocol:state()} | {error, term(), nquic_protocol:state()}.
-spec flush_app(nquic_protocol:state()) -> {ok, [iodata()], nquic_protocol:state()} | {ok, nquic_protocol:state()}.
-spec flush_handshake(nquic_protocol:state()) -> {[iodata()], nquic_protocol:state()}.
-spec flush_initial(nquic_protocol:state()) -> {[iodata()], nquic_protocol:state()}.
-spec maybe_piggyback_ack(nquic_protocol:state()) -> nquic_protocol:state().
-spec queue_app_frame(nquic_frame:t(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
-spec queue_app_frame(nquic_frame:t(), non_neg_integer(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
-spec queue_app_frames([nquic_frame:t()], non_neg_integer(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
-spec queue_app_pre_encoded([nquic_protocol_send:pre_encoded()], non_neg_integer(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
-spec queue_handshake_frame(nquic_frame:t(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
Queue a frame for a Handshake-space packet. Drained by flush/1 into a
Handshake-coalesced packet at the next flush. Used for retransmits of
Handshake CRYPTO and PTO probes between Initial and Established.
-spec queue_initial_frame(nquic_frame:t(), nquic_protocol:state()) -> {ok, nquic_protocol:state()}.
Queue a frame for an Initial-space packet. Drained by flush/1 into an
Initial-coalesced packet at the next flush. Used for retransmits of
client/server Initial CRYPTO and PTO probes during the handshake.
-spec sort_frames([nquic_frame:t()]) -> [nquic_frame:t()].