class Protocol::HTTP2::PingFrame


---------------------------------------------------------------
| |
| Opaque Data (64) |
| |
---------------------------------------------------------------
The PING frame is a mechanism for measuring a minimal round-trip time from the sender, as well as determining whether an idle connection is still functional. PING frames can be sent from any endpoint.

def acknowledge

@returns [PingFrame] A new PING frame marked as an acknowledgement.
Create an acknowledgement PING frame with the same payload.
def acknowledge
	frame = super
	
	frame.pack self.unpack
	
	return frame
end

def apply(connection)

@parameter connection [Connection] The connection to apply the frame to.
Apply this PING frame to a connection for processing.
def apply(connection)
	connection.receive_ping(self)
end

def connection?

@returns [Boolean] Always returns true for PING frames.
Check if this frame applies to the connection level.
def connection?
	true
end

def read_payload(stream)

@raises [ProtocolError] If validation fails.
@parameter stream [IO] The stream to read from.
Read and validate the PING frame payload.
def read_payload(stream)
	super
	
	if @stream_id != 0
		raise ProtocolError, "Settings apply to connection only, but stream_id was given"
	end
	
	if @length != 8
		raise FrameSizeError, "Invalid frame length: #{@length} != 8!"
	end
end