TsgcHTTP3Server › Methods › Start

Start Method

Starts the QUIC listener and begins accepting HTTP/3 connections.

Syntax

procedure Start;

Remarks

Start loads OpenSSL, builds the QUIC server context from the certificate and private key in QUICOptions.SSLOptions, binds a UDP socket to Port and launches the background listener thread that accepts connections, services the QUIC event loop and dispatches OnH3Request. OnStartup is raised once the listener is up.

Start is equivalent to setting Active to True, and it returns as soon as the listener is running: connections are served on the background thread, not by this call. Calling Start on an already running server does nothing.

Everything the listener reads must be configured beforehand: Port, the certificate and key, and any H3Settings you want advertised to clients. The certificate and key are mandatory, because QUIC always runs TLS 1.3; if either is missing, unreadable or the two do not match, Start raises an exception.

The transport is the QUIC engine built into OpenSSL 3.5 or later, which the server uses directly for its listener. There is no fallback: an older OpenSSL has no QUIC listener API, so Start fails against one. Call Stop to shut the server down.

This method is inherited from TsgcQUICServer.

Example


oServer := TsgcHTTP3Server.Create(nil);
oServer.Port := 443;
oServer.QUICOptions.SSLOptions.CertFile := 'cert.pem';
oServer.QUICOptions.SSLOptions.KeyFile := 'key.pem';
oServer.OnH3Request := OnH3RequestEvent;
oServer.Start;

Back to Methods