class Protocol::HTTP2::ResetStreamFrame
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.
---------------------------------------------------------------
| Error
Code (32) | ---------------------------------------------------------------
Constants
- FORMAT
- TYPE
Public Instance Methods
apply(connection)
click to toggle source
# File lib/protocol/http2/reset_stream_frame.rb, line 59 def apply(connection) connection.receive_reset_stream(self) end
pack(error_code = NO_ERROR)
click to toggle source
# File lib/protocol/http2/reset_stream_frame.rb, line 54 def pack(error_code = NO_ERROR) @payload = [error_code].pack(FORMAT) @length = @payload.bytesize end
read_payload(stream)
click to toggle source
Calls superclass method
Protocol::HTTP2::Frame#read_payload
# File lib/protocol/http2/reset_stream_frame.rb, line 63 def read_payload(stream) super if @length != 4 raise FrameSizeError, "Invalid frame length" end end
unpack()
click to toggle source
# File lib/protocol/http2/reset_stream_frame.rb, line 50 def unpack @payload.unpack1(FORMAT) end