Protocol::HTTP2SourceProtocolHTTP2WindowUpdateFrame

class WindowUpdateFrame

The WINDOW_UPDATE frame is used to implement flow control.

+-+-------------------------------------------------------------+ |R| Window Size Increment (31) | +-+-------------------------------------------------------------+

Definitions

def pack(window_size_increment)

Pack a window size increment into the frame.

Signature

parameter window_size_increment Integer

The window size increment value.

Implementation

def pack(window_size_increment)
	super [window_size_increment].pack(FORMAT)
end

def unpack

Unpack the window size increment from the frame payload.

Signature

returns Integer

The window size increment value.

Implementation

def unpack
	super.unpack1(FORMAT)
end

def read_payload(stream)

Read and validate the WINDOW_UPDATE frame payload.

Signature

parameter stream IO

The stream to read from.

raises FrameSizeError

If the frame length is invalid.

Implementation

def read_payload(stream)
	super
	
	if @length != 4
		raise FrameSizeError, "Invalid frame length: #{@length} != 4!"
	end
end

def apply(connection)

Apply this WINDOW_UPDATE frame to a connection for processing.

Signature

parameter connection Connection

The connection to apply the frame to.

Implementation

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