TsgcQUICServer › Events

TsgcQUICServer Events

Events grouped by purpose, followed by the full alphabetical list.

Every event is raised on the server's background listener thread, so marshal to the main thread before touching the UI, and keep handlers short: the QUIC event loop for all connections is blocked while one runs. Each handler receives the TsgcQUICServerConnection it relates to as its aConnection parameter.

Connection lifecycle

NameDescription
OnQUICConnectA connection has been accepted and the peer's first stream is ready, so it is safe to write from the handler.
OnQUICDisconnectA connection has been closed. Not raised for connections dropped by Stop.

Data

NameDescription
OnQUICDataBytes received on the connection's default QUIC stream.
OnQUICStreamDataBytes received on any other stream, tagged with its stream id. Public, not published. Requires AlwaysMultiStream. Delphi only.

Errors

NameDescription
OnQUICExceptionThe listener thread trapped an exception. aConnection is the connection at fault, or nil for a listener-level error. Exceptions from Start do not arrive here.

Server lifecycle (inherited)

NameDescription
OnStartupInherited from the UDP base. Raised by Start once the listener is bound and accepting.
OnShutdownInherited from the UDP base. Raised by Stop once the listener and every connection have been released.

All Events (alphabetical)

NameDescription
OnQUICConnectFires when a new QUIC connection has been accepted and its first stream is ready.
OnQUICDataFires when application data is received from a peer over its default QUIC stream.
OnQUICDisconnectFires when a QUIC connection has been closed, reporting the error code and reason.
OnQUICExceptionFires when an exception is trapped while servicing the QUIC event loop.
OnQUICStreamDataFires with bytes read from an additional QUIC stream, tagged with its stream id.
OnShutdownInherited server-stopped notification. Fires when the server has stopped listening and released its resources.
OnStartupInherited server-started notification. Fires when the server has started listening for QUIC connections.

Using TsgcHTTP3Server

TsgcHTTP3Server descends from TsgcQUICServer and wires OnQUICConnect, OnQUICData, OnQUICStreamData and OnQUICDisconnect to its own handlers in its constructor. Assigning those on an HTTP/3 server replaces the HTTP/3 layer's own plumbing and breaks it. Use the HTTP/3 events instead. OnQUICException is the exception: the HTTP/3 server only claims it if you have not assigned it yourself.