class Protocol::HTTP2::Connection

def read_frame

Reads one frame from the network and processes. Processing the frame updates the state of the connection and related streams. If the frame triggers an error, e.g. a protocol error, the connection will typically emit a goaway frame and re-raise the exception. You should continue processing frames until the underlying connection is closed.
def read_frame
	frame = @framer.read_frame(@local_settings.maximum_frame_size)
	
	# puts "#{self.class} #{@state} read_frame: class=#{frame.class} stream_id=#{frame.stream_id} flags=#{frame.flags} length=#{frame.length} (remote_stream_id=#{@remote_stream_id})"
	# puts "Windows: local_window=#{@local_window.inspect}; remote_window=#{@remote_window.inspect}"
	
	return if ignore_frame?(frame)
	
	yield frame if block_given?
	frame.apply(self)
	
	return frame
rescue GoawayError => error
	# Go directly to jail. Do not pass go, do not collect $200.
	raise
rescue ProtocolError => error
	send_goaway(error.code || PROTOCOL_ERROR, error.message)
	
	raise
rescue HPACK::Error => error
	send_goaway(COMPRESSION_ERROR, error.message)
	
	raise
end