Module: Protocol::HTTP2::Acknowledgement

Included in:
PingFrame, SettingsFrame
Defined in:
lib/protocol/http2/ping_frame.rb

Overview

Provides acknowledgement functionality for frames that support it. This module handles setting and checking acknowledgement flags on frames.

Instance Method Summary collapse

Instance Method Details

#acknowledgeObject

Create an acknowledgement frame for this frame.



28
29
30
31
32
33
34
35
# File 'lib/protocol/http2/ping_frame.rb', line 28

def acknowledge
	frame = self.class.new
	
	frame.length = 0
	frame.set_flags(ACKNOWLEDGEMENT)
	
	return frame
end

#acknowledgement!Object

Mark this frame as an acknowledgement.



22
23
24
# File 'lib/protocol/http2/ping_frame.rb', line 22

def acknowledgement!
	set_flags(ACKNOWLEDGEMENT)
end

#acknowledgement?Boolean

Check if the frame is an acknowledgement.

Returns:

  • (Boolean)


17
18
19
# File 'lib/protocol/http2/ping_frame.rb', line 17

def acknowledgement?
	flag_set?(ACKNOWLEDGEMENT)
end