class Protocol::HTTP2::SettingsFrame


---------------------------------------------------------------
| Value (32) |
-------------------------------——————————-+
| Identifier (16) |
-------------------------------
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”.

def apply(connection)

def apply(connection)
	connection.receive_settings(self)
end

def connection?

def connection?
	true
end

def pack(settings = [])

def pack(settings = [])
	super(settings.map{|s| s.pack(FORMAT)}.join)
end

def read_payload(stream)

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

def unpack

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