TsgcHTTP2ClientEvents › OnHTTP2Disconnect

OnHTTP2Disconnect Event

Fires when the HTTP/2 connection has been closed.

Syntax

property OnHTTP2Disconnect: TsgcHTTP2ClientDisconnectEvent;
// TsgcHTTP2ClientDisconnectEvent = procedure(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient) of object

Default Value

Remarks

OnHTTP2Disconnect is raised after the HTTP/2 connection has been closed, either because the application called Close or Disconnect, the server sent a GoAway and the connection terminated, the socket dropped unexpectedly, or the TLS layer was torn down. Use this event to release per-connection resources and to log the disconnection. If WatchDog is enabled the client will attempt to reconnect automatically after the event returns, and OnHTTP2PendingRequests is raised too when there are queued requests so the application can decide whether to retry them.

Example


procedure OnHTTP2DisconnectEvent(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient);
begin
  Log('HTTP/2 connection closed');
end;

Back to Events