Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Quic.Output

Feature notes: Asynchronous QUIC server and HTTP/3 component

Classes, interfaces and records

recordtQuicPacketLayout

Level: tQuicEncryptionLevel; Version: Cardinal; DestinationID, SourceID, Token: TBytes; PacketNumber: UInt64; PacketNumberLen: Integer; KeyPhase, Spin: Boolean;

recordtQuicPacketDraft

Header, Payload: TBytes; PacketNumberOffset, WireBytes: Integer; AckEliciting: Boolean;

classtQuicOutputQueue

Calls require external serialization. The stream manager is borrowed only for the call. Const buffers may be retained read-only: aliases must not mutate their elements. ACK/loss inputs describe validated sent packets. They are delivery information, never packets to replay verbatim.

Peek prepares one bounded frame without removing needed work. Commit validates that frame in the actual transmitted payload before removing work. Fresh ACK/PADDING/PING may accompany it. Failed sends leave work queued but consume allocated packet numbers. Repeating Peek refreshes the selection. ACKs retire CRYPTO and cancel pending work, including prior loss/PTO work. Apply STREAM/RESET ACKs to the stream manager before selecting again.

CRYPTO offsets are contiguous per level. Bytes, retained/pending ranges and controls have explicit budgets. Resource failure raises eQuicError; the host closes rather than losing recovery metadata. STOP_SENDING, RESET_STREAM, HANDSHAKE_DONE, connection ID and current MAX_* controls are retained until acknowledged or superseded. Old ACK, PADDING, PING, CLOSE, NEW_TOKEN and path frames are never replayed. The host builds fresh ACKs and fallback PTO PINGs. CRYPTO precedes other queued work. Pending controls and streams alternate when both fit. Stream selection rotates by stream ID after a committed STREAM frame; all ranges of one stream share that turn. Peek and failed sends do not advance either scheduling cursor. Create a new queue after Retry.

constructor Create(aMaxCryptoBytes: Integer = 1048576; aMaxRanges: Integer = 256; aMaxControls: Integer = 256); procedure PrepareSendWindow(aStreams: tQuicStreamManager; aMaxBytes, aMaxRanges, aMaxStreams: Integer);
Transactional preparation before any STREAM work, including empty FINs. Pending STREAM intervals, including empty FINs, share max(256, W div 256) slots. Copy-on-change arrays make tiny selective-ACK holes costly; prefer closing that connection to giving a peer a large CPU lever. CRYPTO and retained control budgets keep their independent bounds.
procedure QueueCrypto(aLevel: tQuicEncryptionLevel; aOffset: UInt64; const aData: TBytes); procedure QueueStream(aStreamID, aOffset, aLength: UInt64; aFin: Boolean); procedure QueueControl(const aFrame: tQuicFrame); procedure Lost(aLevel: tQuicEncryptionLevel; const aPayload: TBytes; aStreams: tQuicStreamManager = nil);
Lost also supplies PTO candidates without declaring them lost. Only still-retained information becomes pending work. CRYPTO and control recovery accepts a nil manager. A supplied manager filters retired STREAM frames; the client may omit this filter.
procedure Acknowledged(aLevel: tQuicEncryptionLevel; const aPayload: TBytes); function HasReady(aLevel: tQuicEncryptionLevel; aMaxPayload: Integer; aStreams: tQuicStreamManager): Boolean;
Tests fitting retained work without creating payload buffers or changing the prepared selection, scheduling cursors or queue contents.
function Peek(aLevel: tQuicEncryptionLevel; aMaxPayload: Integer; aStreams: tQuicStreamManager; out aPayload: TBytes): Boolean; procedure Commit(aLevel: tQuicEncryptionLevel; const aPayload: TBytes); procedure DiscardLevel(aLevel: tQuicEncryptionLevel); procedure RejectEarlyData;
Rejection cancels staged application work; it never invokes a producer or resets the connection's shared application packet-number sequence.
procedure CopyRetainedControls(aDestination: tQuicOutputQueue; aStreams: tQuicStreamManager);
Retry copies retained controls to a fresh Initial-flight queue. Stream bytes are recovered separately from the borrowed stream manager.
property CryptoBytes: Integer read fCryptoBytes;

Routines