class Protocol::HTTP2::SettingsFrame
The SETTINGS frame conveys configuration parameters that affect how endpoints communicate, such as preferences and constraints on peer behavior. The SETTINGS frame is also used to acknowledge the receipt of those parameters. Individually, a SETTINGS parameter can also be referred to as a “setting”.
-------------------------------
| Identifier (16) | -------------------------------
——————————-+ | Value (32) | ---------------------------------------------------------------
Constants
- FORMAT
- TYPE
Public Instance Methods
apply(connection)
click to toggle source
# File lib/protocol/http2/settings_frame.rb, line 246 def apply(connection) connection.receive_settings(self) end
connection?()
click to toggle source
# File lib/protocol/http2/settings_frame.rb, line 229 def connection? true end
pack(settings = [])
click to toggle source
Calls superclass method
Protocol::HTTP2::Frame#pack
# File lib/protocol/http2/settings_frame.rb, line 242 def pack(settings = []) super(settings.map{|s| s.pack(FORMAT)}.join) end
read_payload(stream)
click to toggle source
Calls superclass method
Protocol::HTTP2::Frame#read_payload
# File lib/protocol/http2/settings_frame.rb, line 250 def read_payload(stream) super if @stream_id != 0 raise ProtocolError, "Settings apply to connection only, but stream_id was given" end if acknowledgement? and @length != 0 raise FrameSizeError, "Settings acknowledgement must not contain payload: #{@payload.inspect}" end if (@length % 6) != 0 raise FrameSizeError, "Invalid frame length" end end
unpack()
click to toggle source
Calls superclass method
Protocol::HTTP2::Frame#unpack
# File lib/protocol/http2/settings_frame.rb, line 233 def unpack if buffer = super # TODO String#each_slice, or #each_unpack would be nice. buffer.scan(/....../m).map{|s| s.unpack(FORMAT)} else [] end end