Method: Protocol::HTTP2::Connection#send_goaway

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

#send_goaway(error_code = 0, message = "") ⇒ Object

Tell the remote end that the connection is being shut down. If the ‘error_code` is 0, this is a graceful shutdown. The other end of the connection should not make any new streams, but existing streams may be completed.



208
209
210
211
212
213
214
215
# File 'lib/protocol/http2/connection.rb', line 208

def send_goaway(error_code = 0, message = "")
  frame = GoawayFrame.new
  frame.pack @remote_stream_id, error_code, message
  
  write_frame(frame)
ensure
  self.close!
end