Feature notes: HTTPS application layer notes (HTTP/1.1, h2, h3)
An HTTP/3 client connection over a tQuicClient that you create and own, with its socket and TLS host; all three must outlive this adapter. Set up the QUIC client (certificate validation, server name, ALPN h3), create the adapter over it with your iHttp3ClientObserver, then call QUIC.Start. Then loop: Pump(now), and wait until the socket is readable or the NextWakeup deadline is due. Pump reads the socket, starts HTTP/3 once the handshake is authenticated with h3, delivers input to the observer and flushes output, so do not poll QUIC yourself. Pass one monotone microsecond clock; a Pump time lower than the last one raises. One Pump delivers a bounded amount of input: while more is waiting, StreamWorkPending is True and NextWakeup returns aNowMicros. Once Ready, call StartRequest; the request and body methods forward to Engine and are described on tHttp3ClientConn. Call ReleaseBody for consumed body bytes after the callback has returned. Calls must come from one thread at a time (there is no lock) and never from an observer callback, which raises. Engine is owned and freed by the adapter; use it for status and counters. To finish, close the QUIC client (a later Pump reports ConnectionFailed), then free the adapter before the QUIC client. For 0-RTT see CaptureResumptionTicket.
constructor Create(aQuic: tQuicClient; const aObserver: iHttp3ClientObserver); overload;
constructor Create(aQuic: tQuicClient; const aObserver: iHttp3ClientObserver; const aLimits: tHttp3ClientLimits); overload;
destructor Destroy; override;
function CaptureResumptionTicket(aTicket: TTls13ClientTicket): tQuicSessionTicket;
function ConfigureEarlyData(aTicket: tQuicSessionTicket; aNow: TDateTime): Boolean;
procedure Pump(aNowMicros: UInt64);
function NextWakeup(aNowMicros: UInt64; out aDeadline: UInt64): Boolean;
function StreamWorkPending: Boolean;
function StartEarlyRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes): UInt64;
function StartRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes): UInt64; overload;
function StartRequest(const aMethod, aScheme, aAuthority, aPath: string; const aHeaders: tQpackFields; const aBody: TBytes; aEndStream: Boolean): UInt64; overload;
function RequestBodyOpen(aStreamID: UInt64): Boolean;
function RequestBodyCapacity(aStreamID: UInt64): Integer;
function TrySendBody(aStreamID: UInt64; const aData: TBytes; aEndStream: Boolean): Boolean;
function TrySendTrailers(aStreamID: UInt64; const aTrailers: tHttpHeaders): Boolean;
procedure ReleaseBody(aStreamID, aCount: UInt64);
procedure ReleasePushBody(aPushID, aCount: UInt64);
procedure CancelPush(aPushID: UInt64);
procedure BeginPushDrain(aFirstRejectedPushID: UInt64);
procedure Cancel(aStreamID: UInt64);
property Ready: Boolean read GetReady;
property EarlyReady: Boolean read GetEarlyReady;
property Engine: tHttp3ClientConn read fEngine;