class Protocol::HTTP2::ResetStreamFrame
---------------------------------------------------------------
| Error Code (32) |---------------------------------------------------------------
The RST_STREAM frame allows for immediate termination of a stream. RST_STREAM is sent to request cancellation of a stream or to indicate that an error condition has occurred.
def apply(connection)
Apply this RST_STREAM frame to a connection for processing.
def apply(connection) connection.receive_reset_stream(self) end
def pack(error_code = NO_ERROR)
Pack an error code into the frame payload.
def pack(error_code = NO_ERROR) @payload = [error_code].pack(FORMAT) @length = @payload.bytesize end
def read_payload(stream)
@parameter stream [IO] The stream to read from.
Read and validate the RST_STREAM frame payload.
def read_payload(stream) super if @length != 4 raise FrameSizeError, "Invalid frame length" end end
def unpack
Unpack the error code from the frame payload.
def unpack @payload.unpack1(FORMAT) end