Method: HTTP::Protocol::HTTP2::Connection#send_ping

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

#send_ping(data) ⇒ Object



162
163
164
165
166
167
168
169
170
171
# File 'lib/http/protocol/http2/connection.rb', line 162

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