class HTTP2::Connection

Overview

The Connection class encapsulates an HTTP2 connection. It handles all of the work of managing and coordinating the streams that make up the connection.

Defined in:

connection.cr
connection/defaults.cr

Constant Summary

LocalDefaults = Defaults.new(max_concurrent_streams: 100_u32)
Preface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n".to_slice

All client connections are initiated with this specific sequence of characters. https://datatracker.ietf.org/doc/html/rfc7540#section-3.5

RemoteDefaults = Defaults.new

Constructors

Instance Method Summary

Constructor Detail

def self.new(host : String, port : String | Int = 80, initial_window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window), window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window)) #

[View source]
def self.new(socket : IO, initial_window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window), window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window)) #

[View source]

Instance Method Detail

def active_stream_count : UInt32 #

[View source]
def closed? #

[View source]
def delete_stream(id) #

[View source]
def encode(headers : HTTP::Headers) #

[View source]
def local_settings #

[View source]
def local_window : UInt32 #

[View source]
def new_stream #

[View source]
def next_stream_id #

Returns the next available stream ID.


[View source]
def read_frame #

[View source]
def remote_window : UInt32 #

[View source]
def send_preface #

[View source]
def stream(id) #

[View source]
def stream #

[View source]
def write_frame(frame : Frames) #

[View source]