Feature notes: Asynchronous QUIC server and HTTP/3 component
MaxData: UInt64;
MaxStreamDataBidiLocal: UInt64;
MaxStreamDataBidiRemote: UInt64;
MaxStreamDataUni: UInt64;
MaxStreamsBidi: UInt64;
MaxStreamsUni: UInt64;
MaxStreams: Integer;
MaxBufferedBytes: Integer;
MaxRangesPerStream: Integer;
StreamID: UInt64;
SendState: tQuicStreamSendState;
ReceiveState: tQuicStreamReceiveState;
SendOffset: UInt64;
SendLimit: UInt64;
ReceiveHighest: UInt64;
ReceiveOffset: UInt64;
ReceiveLimit: UInt64;
FinalSize: UInt64;
FinalSizeKnown: Boolean;
FinQueued: Boolean;
FinSent: Boolean;
FinAcknowledged: Boolean;
StopSendingReceived: Boolean;
StopError: UInt64;
ResetError: UInt64;
ReceiveError: UInt64;
ReleasedReceiveCredit: UInt64;
BufferedSendBytes: Integer;
BufferedReceiveBytes: Integer;
Calls require external serialization. Stream IDs are sparse: a high ID implicitly opens lower IDs of that type without allocating them. Only materialized records and sparse retired ranges consume MaxStreams. Explicit retirement requires both transport directions complete and an application release. Per-type retired floors and sparse ranges prevent reopening without retaining a record for every completed request. Resource exhaustion fails explicitly. Configure advertised credit together with budgets; a peer may use all granted credit.
MaxBufferedBytes bounds physical retained send allocations and receive bytes together. RetainedSendBytes charges the full backing array of each admission until its final fragment retires; Buffered* count logical bytes. Each direction has at most MaxRangesPerStream ranges. Replacement metadata and receive reassembly need at most an additional copy of their budgets. Buffers passed as const may be retained read-only; no alias may subsequently modify their elements. Copies provide independence wherever reassembly requires mutation. Returned arrays may be retained as shared read-only buffers.
Taking data or releasing TBytes references never grants network credit. ReleaseReceiveCredit records explicit consumption. IncreaseReceive* calls explicitly authorize new advertised maxima. The scheduler transmits and retransmits MAX_* and RESET_STREAM frames using the current state; this class does not send packets or run timers. MAX_STREAMS counts all opened streams, including terminated streams, and is never recycled implicitly.
constructor Create(aRole: tQuicRole; const aLocalLimits, aPeerLimits: tQuicStreamLimits; const aBudgets: tQuicStreamBudgets);
destructor Destroy; override;
procedure ApplyFreshLimits(const aLocal, aPeer: tQuicStreamLimits);
procedure ConfigureSendWindow(aMaxBytes: Integer);
procedure PrepareSendWindow(aMaxBytes, aMaxRanges: Integer);
function CanRetireStream(aStreamID: UInt64): Boolean;
function RetireStream(aStreamID: UInt64): Boolean;
function IsRetiredStream(aStreamID: UInt64): Boolean;
function PeerOpenedStreams(aUnidirectional: Boolean): UInt64;
function PeerUnmaterializedStreams(aUnidirectional: Boolean): UInt64;
function StreamRecordReservation: UInt64;
property MetadataCount: Integer read GetMetadataCount;
function MaxStreamRecords: Integer;
function OpenStream(aUnidirectional: Boolean): UInt64;
procedure ReceiveStream(aStreamID, aOffset: UInt64; const aData: TBytes; aFin: Boolean); overload;
procedure ReceiveStream(aStreamID, aOffset: UInt64; const aData: TBytes; aFin, aEarly: Boolean); overload;
procedure ReceiveReset(aStreamID, aError, aFinalSize: UInt64);
procedure ReceiveStopSending(aStreamID, aError: UInt64);
procedure ReceiveStreamDataBlocked(aStreamID: UInt64);
procedure ReceiveMaxData(aLimit: UInt64);
procedure ReceiveMaxStreamData(aStreamID, aLimit: UInt64);
procedure ReceiveMaxStreams(aUnidirectional: Boolean; aLimit: UInt64);
function QueueSend(aStreamID: UInt64; const aData: TBytes; aFin: Boolean): UInt64; overload;
function QueueSend(aStreamID: UInt64; const aData: TBytes; aDataOffset, aCount: Integer; aFin: Boolean): UInt64; overload;
function CopySend(aStreamID, aOffset: UInt64; aMaxBytes: Integer; out aData: TBytes; out aFin: Boolean): Boolean;
function FindSendInfo(aStreamID, aAtOrAfter: UInt64; aMaxBytes: Integer; out aOffset: UInt64; out aCount: Integer; out aFin: Boolean): Boolean;
function FindSend(aStreamID, aAtOrAfter: UInt64; aMaxBytes: Integer; out aOffset: UInt64; out aData: TBytes; out aFin: Boolean): Boolean;
function FindSendSlice(aStreamID, aAtOrAfter: UInt64; aMaxBytes: Integer; out aOffset: UInt64; out aData: TBytes; out aDataOffset, aCount: Integer; out aFin: Boolean): Boolean;
procedure MarkSent(aStreamID, aOffset, aLength: UInt64; aFin: Boolean);
procedure AcknowledgeSend(aStreamID, aOffset, aLength: UInt64; aFin: Boolean);
procedure ResetSend(aStreamID, aError: UInt64);
procedure MarkResetSent(aStreamID: UInt64);
procedure AcknowledgeReset(aStreamID: UInt64);
function TakeReceived(aStreamID: UInt64; out aData: TBytes; out aFin: Boolean): Boolean; overload;
function TakeReceived(aStreamID: UInt64; out aData: TBytes; out aFin, aEarly: Boolean): Boolean; overload;
function StreamHasEarlyData(aStreamID: UInt64): Boolean;
function ConsumeReset(aStreamID: UInt64; out aError: UInt64): Boolean;
procedure ReleaseReceiveCredit(aStreamID, aCount: UInt64);
procedure IncreaseReceiveMaxData(aLimit: UInt64);
procedure IncreaseReceiveMaxStreamData(aStreamID, aLimit: UInt64);
procedure IncreaseReceiveMaxStreams(aUnidirectional: Boolean; aLimit: UInt64);
function GetStreamInfo(aStreamID: UInt64; out aInfo: tQuicStreamInfo): Boolean;
function StreamIDAt(aIndex: Integer; out aStreamID: UInt64): Boolean;
procedure SetLookupKey(aKey: UInt64);
function FindStreamIndex(aStreamID: UInt64; out aIndex: Integer): Boolean;
function TakeServiceStream(out aStreamID: UInt64; out aIndex: Integer): Boolean;
function RequestService(aStreamID: UInt64): Boolean;
function SendCapacity(aStreamID: UInt64): Integer;
function CanOpenStream(aUnidirectional: Boolean): Boolean;
property LocalLimits: tQuicStreamLimits read fLocalLimits;
property PeerLimits: tQuicStreamLimits read fPeerLimits;
property ReceivedDataCount: UInt64 read fReceivedData;
property SentDataCount: UInt64 read fQueuedData;
property ReleasedReceiveCredit: UInt64 read fReleasedReceiveCredit;
property MaxSendBytes: Integer read fMaxSendBytes;
property SendBufferCapacity: Integer read GetSendBufferCapacity;
property RetainedBytes: Integer read GetRetainedBytes;
property RetainedSendBytes: Integer read fRetainedSendBytes;
property BufferedBytes: Integer read fBufferedBytes;
property BufferedSendBytes: Integer read fBufferedSendBytes;
property BufferedReceiveBytes: Integer read fBufferedReceiveBytes;
property MaxReceiveRanges: Integer read fMaxReceiveRanges;
property MaxReceiveRangesTotal: Integer read fMaxReceiveRangesTotal;
property ReceiveRangeCount: Integer read fReceiveRangeCount;
property ReceiveBytesCopied: Int64 read fReceiveBytesCopied;
property StreamCount: Integer read GetStreamCount;
property ServicePending: Boolean read GetServicePending;