TsgcHTTP3Client › Events › OnDisconnect

OnDisconnect Event

Fires after the HTTP/3 connection has been closed.

Syntax

property OnDisconnect: TNotifyEvent read FOnDisconnect write FOnDisconnect;

Parameters

NameTypeDescription
SenderTObjectThe TsgcHTTP3Client instance that raised the event.

Remarks

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.

Example



procedure TfrmMain.OnDisconnectEvent(Sender: TObject);

begin

  Log('disconnected');

end;

Back to Events