Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.Quic.Connection

Feature notes: Asynchronous QUIC server and HTTP/3 component

Classes, interfaces and records

recordtQuicCryptoChunk

Level: tQuicEncryptionLevel; Offset: UInt64; Data: TBytes;

classtQuicConnectionState

Serialized connection bookkeeping, independent of a socket and TLS engine. InstallKeys is called only after the corresponding packet cipher exists. PacketReceived accepts authenticated packets only; its caller buffers undecryptable packets separately. CanRead also enforces the TLS completion barrier for 1-RTT. The caller owns ACK/recovery state and close timers. Protocol errors enter Closing and raise eQuicTransportError; local API misuse raises eQuicError. Early keys require explicit remembered limits; the TLS bridge supplies the authenticated acceptance decision.

constructor Create(aRole: tQuicRole; const aParameterContext: tQuicTransportParameterContext; aMaxCryptoBufferBytes: Integer = 1048576; aMaxCryptoRanges: Integer = 256; aMaxOutputChunks: Integer = 256); destructor Destroy; override; procedure SetParameterContext( const aContext: tQuicTransportParameterContext);
Observations may be updated as the peer Initial or Retry is received, before peer parameters are accepted. Values are copied independently.
procedure Start; procedure ConfigureEarlyParameters(const aParameters: tQuicTransportParameters); procedure SetEarlyDataDecision(aAccepted: Boolean); procedure DiscardEarlyData; property EarlyParameters: tQuicTransportParameters read GetEarlyParameters; property EarlyParametersAvailable: Boolean read fEarlyParametersAvailable; property EarlyDataOffered: Boolean read fEarlyOffered; property EarlyDataAccepted: Boolean read fEarlyAccepted; property EarlyDataRejected: Boolean read fEarlyRejected; procedure InstallKeys(aLevel: tQuicEncryptionLevel; aIncoming: Boolean); procedure AdvanceReadLevel(aLevel: tQuicEncryptionLevel);
TLS receiving-level advancement is distinct from key availability. All earlier CRYPTO bytes must already have been handed to TLS.
function KeysAvailable(aLevel: tQuicEncryptionLevel; aIncoming: Boolean): Boolean; function CanRead(aLevel: tQuicEncryptionLevel): Boolean;
Delegates to KeysAvailable, passing 2 argument(s), and returns its result.
function CanWrite(aLevel: tQuicEncryptionLevel): Boolean;
Delegates to KeysAvailable, passing 2 argument(s), and returns its result.
procedure DiscardKeys(aLevel: tQuicEncryptionLevel); procedure ReceiveCrypto(aLevel: tQuicEncryptionLevel; aOffset: UInt64; const aData: TBytes); function TakeCryptoInput(aLevel: tQuicEncryptionLevel): TBytes; procedure QueueCrypto(aLevel: tQuicEncryptionLevel; const aData: TBytes);
Queued arrays are retained as shared read-only data. TakeCryptoOutput transfers a reference to the packet/recovery owner, which must retain it until acknowledged or the level is discarded. TLS callbacks never reenter TLS; the driver drains these queues after TLS returns.
function TakeCryptoOutput(out aChunk: tQuicCryptoChunk): Boolean; procedure ValidatePeerParameters(const aData: TBytes); procedure CompleteHandshake(const aApplicationProtocol: TBytes);
Call only after TLS verifies Finished, reports completion and selects an authenticated ALPN token. Parameters stay tentative until then.
procedure ReceiveHandshakeDone; function AllocatePacketNumber(aLevel: tQuicEncryptionLevel): UInt64; function ExpectedPacketNumber(aLevel: tQuicEncryptionLevel): UInt64; procedure PacketSent(aLevel: tQuicEncryptionLevel); procedure PacketReceived(aLevel: tQuicEncryptionLevel; aPacketNumber: UInt64); procedure BeginClosing(aErrorCode: UInt64); procedure PeerClosed(aErrorCode: UInt64); procedure FinishClose; property Role: tQuicRole read fRole; property Phase: tQuicConnectionPhase read fPhase; property ReadLevel: tQuicEncryptionLevel read fReadLevel; property HandshakeComplete: Boolean read fHandshakeComplete; property HandshakeConfirmed: Boolean read fHandshakeConfirmed; property PeerParametersValidated: Boolean read fPeerParametersValidated; property PeerParametersAuthenticated: Boolean read GetPeerParametersAuthenticated; property PeerParameters: tQuicTransportParameters read GetPeerParameters; property ApplicationProtocol: TBytes read GetApplicationProtocol; property ErrorCode: UInt64 read fErrorCode;