Class: Protocol::HTTP2::Server
- Inherits:
-
Connection
- Object
- Connection
- Protocol::HTTP2::Server
- Defined in:
- lib/protocol/http2/server.rb
Instance Attribute Summary
Attributes inherited from Connection
#framer, #local_settings, #local_window, #remote_settings, #remote_window, #state, #streams
Instance Method Summary collapse
- #enable_push? ⇒ Boolean
-
#initialize(framer) ⇒ Server
constructor
A new instance of Server.
- #read_connection_preface(settings = []) ⇒ Object
- #receive_push_promise ⇒ Object
Methods inherited from Connection
#close, #closed?, #create_stream, #decode_headers, #deleted_stream?, #encode_headers, #id, #maximum_concurrent_streams, #maximum_frame_size, #next_stream_id, #open!, #process_settings, #read_frame, #receive_data, #receive_frame, #receive_goaway, #receive_headers, #receive_ping, #receive_priority, #receive_reset_stream, #receive_settings, #receive_window_update, #send_goaway, #send_ping, #send_settings, #update_local_settings, #update_remote_settings, #window_updated, #write_frame
Methods included from FlowControl
#available_frame_size, #consume_local_window, #consume_remote_window, #receive_window_update, #send_window_update, #window_updated
Constructor Details
#initialize(framer) ⇒ Server
Returns a new instance of Server.
26 27 28 |
# File 'lib/protocol/http2/server.rb', line 26 def initialize(framer) super(framer, 2) end |
Instance Method Details
#enable_push? ⇒ Boolean
44 45 46 |
# File 'lib/protocol/http2/server.rb', line 44 def enable_push? @remote_settings.enable_push? end |
#read_connection_preface(settings = []) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/protocol/http2/server.rb', line 30 def read_connection_preface(settings = []) if @state == :new @framer.read_connection_preface send_settings(settings) read_frame do |frame| raise ProtocolError, "First frame must be SettingsFrame, but got #{frame.class}" unless frame.is_a? SettingsFrame end else raise ProtocolError, "Cannot send connection preface in state #{@state}" end end |
#receive_push_promise ⇒ Object
48 49 50 |
# File 'lib/protocol/http2/server.rb', line 48 def receive_push_promise raise ProtocolError, "Server cannot receive push promises." end |