TsgcHTTP2Client › Events › OnHTTP2GoAway
Fires when the server sends a GoAway frame signalling the connection is being shut down.
property OnHTTP2GoAway: TsgcHTTP2ClientGoAwayEvent;
// TsgcHTTP2ClientGoAwayEvent = procedure(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient; const GoAway: TsgcHTTP2GoAwayProperty) of object
—
OnHTTP2GoAway is raised when the server sends a GOAWAY frame to announce that it will stop accepting new streams on the connection, typically because it is being restarted, overloaded, or enforcing a graceful shutdown. The GoAway parameter exposes the last stream identifier the server processed, the HTTP/2 error code and any additional debug data returned by the peer, so the application can tell which in-flight requests were completed and which ones need to be retried on a new connection. The event is informational: the client still finishes the already accepted streams and will close the connection afterwards.
procedure OnHTTP2GoAwayEvent(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient;
const GoAway: TsgcHTTP2GoAwayProperty);
begin
Log(Format('GoAway received: last stream %d, error %d',
[GoAway.LastStreamId, GoAway.ErrorCode]));
end;