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
| Name | Description |
| OnQUICConnect | A connection has been accepted and the peer's first stream is ready, so it is safe to write from the handler. |
| OnQUICDisconnect | A connection has been closed. Not raised for connections dropped by Stop. |
Data
| Name | Description |
| OnQUICData | Bytes received on the connection's default QUIC stream. |
| OnQUICStreamData | Bytes received on any other stream, tagged with its stream id. Public, not published. Requires AlwaysMultiStream. Delphi only. |
Errors
| Name | Description |
| OnQUICException | The 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)
| Name | Description |
| OnStartup | Inherited from the UDP base. Raised by Start once the listener is bound and accepting. |
| OnShutdown | Inherited from the UDP base. Raised by Stop once the listener and every connection have been released. |
All Events (alphabetical)
| Name | Description |
| OnQUICConnect | Fires when a new QUIC connection has been accepted and its first stream is ready. |
| OnQUICData | Fires when application data is received from a peer over its default QUIC stream. |
| OnQUICDisconnect | Fires when a QUIC connection has been closed, reporting the error code and reason. |
| OnQUICException | Fires when an exception is trapped while servicing the QUIC event loop. |
| OnQUICStreamData | Fires with bytes read from an additional QUIC stream, tagged with its stream id. |
| OnShutdown | Inherited server-stopped notification. Fires when the server has stopped listening and released its resources. |
| OnStartup | Inherited 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.