TsgcHTTP3Client › Events › OnDisconnect
Fires after the HTTP/3 connection has been closed.
property OnDisconnect: TNotifyEvent read FOnDisconnect write FOnDisconnect;
| Name | Type | Description |
|---|---|---|
Sender | TObject | The TsgcHTTP3Client instance that raised the event. |
OnDisconnect fires once the QUIC connection has been closed, whether the close was requested locally through Disconnect, initiated by the server, or caused by a protocol or transport error. After it fires Connected returns False and any request still in flight has been abandoned.
The event does not say why the connection ended. Pair it with OnError to distinguish a failure from an orderly shutdown, and with OnGoAway to detect a graceful server-initiated close.
This is the right place to trigger a reconnect, but do not call Connect from inside the handler. Schedule it instead, for example from a timer.
procedure TfrmMain.OnDisconnectEvent(Sender: TObject);
begin
Log('disconnected');
end;