class Protocol::HTTP2::Server

Public Class Methods

new(framer) click to toggle source
Calls superclass method Protocol::HTTP2::Connection::new
# File lib/protocol/http2/server.rb, line 26
def initialize(framer)
        super(framer, 2)
end

Public Instance Methods

accept_push_promise_stream(stream_id, &block) click to toggle source
# File lib/protocol/http2/server.rb, line 56
def accept_push_promise_stream(stream_id, &block)
        raise ProtocolError, "Cannot accept push promises on server!"
end
enable_push?() click to toggle source
# File lib/protocol/http2/server.rb, line 60
def enable_push?
        @remote_settings.enable_push?
end
local_stream_id?(id) click to toggle source
# File lib/protocol/http2/server.rb, line 30
def local_stream_id?(id)
        id.even?
end
read_connection_preface(settings = []) click to toggle source
# File lib/protocol/http2/server.rb, line 42
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
remote_stream_id?(id) click to toggle source
# File lib/protocol/http2/server.rb, line 34
def remote_stream_id?(id)
        id.odd?
end
valid_remote_stream_id?(stream_id) click to toggle source
# File lib/protocol/http2/server.rb, line 38
def valid_remote_stream_id?(stream_id)
        stream_id.odd?
end