Method: HTTP::Protocol::HTTP2::Connection#receive_ping

Defined in:
lib/http/protocol/http2/connection.rb

#receive_ping(frame) ⇒ Object



232
233
234
235
236
237
238
239
240
241
242
# File 'lib/http/protocol/http2/connection.rb', line 232

def receive_ping(frame)
  if @state != :closed
    unless frame.acknowledgement?
      reply = frame.acknowledge
      
      write_frame(reply)
    end
  else
    raise ProtocolError, "Cannot receive ping in state #{@state}"
  end
end