class WindowUpdateFrame < Frame

Inherits from
Frame: #valid_type?, #<=>, #to_ary, #set_flags, #clear_flags, #flag_set?, #connection?, #header, #read_header, #read, #write_header, #write_payload, #write, #inspect, .parse_header

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