TsgcHTTP2Client › Events › OnHTTP2RSTStream
Fires when the server resets a specific HTTP/2 stream.
property OnHTTP2RSTStream: TsgcHTTP2ClientRSTStreamEvent;
// TsgcHTTP2ClientRSTStreamEvent = procedure(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient; const RSTStream: TsgcHTTP2RSTStreamProperty) of object
—
OnHTTP2RSTStream is raised when the server sends an RST_STREAM frame to abort a single stream while keeping the underlying connection open, for example when a request is refused, a pushed resource is no longer needed, or a server-side timeout expires. The RSTStream parameter exposes the HTTP/2 ErrorCode and its ErrorDescription so the application can log the reason and, if needed, retry the request on a new stream. Other in-flight streams on the same Connection are not affected and keep receiving data.
procedure OnHTTP2RSTStreamEvent(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient;
const RSTStream: TsgcHTTP2RSTStreamProperty);
begin
Log(Format('Stream reset: %d - %s',
[RSTStream.ErrorCode, RSTStream.ErrorDescription]));
end;