Method: Protocol::HTTP2::Connection#send_ping

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

#send_ping(data) ⇒ Object



159
160
161
162
163
164
165
166
167
168
# File 'lib/protocol/http2/connection.rb', line 159

def send_ping(data)
  if @state != :closed
    frame = PingFrame.new
    frame.pack data
    
    write_frame(frame)
  else
    raise ProtocolError, "Cannot send ping in state #{@state}"
  end
end