TsgcHTTP2ClientEventos › OnHTTP2RSTStream

OnHTTP2RSTStream Evento

Se dispara cuando el servidor restablece un stream HTTP/2 específico.

Sintaxis

property OnHTTP2RSTStream: TsgcHTTP2ClientRSTStreamEvent;
// TsgcHTTP2ClientRSTStreamEvent = procedure(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient; const RSTStream: TsgcHTTP2RSTStreamProperty) of object

Valor Predeterminado

Observaciones

OnHTTP2RSTStream se genera cuando el servidor envía un frame RST_STREAM para cancelar un único stream manteniendo la conexión subyacente abierta, por ejemplo cuando se rechaza una solicitud, un recurso enviado por push ya no es necesario o expira un tiempo de espera del lado del servidor. El parámetro RSTStream expone el ErrorCode de HTTP/2 y su ErrorDescription para que la aplicación pueda registrar el motivo y, si es necesario, reintentar la solicitud en un nuevo stream. Los demás streams en curso sobre la misma Connection no se ven afectados y continúan recibiendo datos.

Ejemplo


procedure OnHTTP2RSTStreamEvent(Sender: TObject; const Connection: TsgcHTTP2ConnectionClient;
  const RSTStream: TsgcHTTP2RSTStreamProperty);
begin
  Log(Format('Stream reset: %d - %s',
    [RSTStream.ErrorCode, RSTStream.ErrorDescription]));
end;

Volver a Eventos