class HTTP2::Connection
- HTTP2::Connection
- Reference
- Object
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.crconnection/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
- .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))
- .new(socket : IO, initial_window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window), window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window))
Instance Method Summary
- #active_stream_count : UInt32
- #closed?
- #delete_stream(id)
- #encode(headers : HTTP::Headers)
- #local_settings
- #local_window : UInt32
- #new_stream
-
#next_stream_id
Returns the next available stream ID.
- #read_frame
- #remote_window : UInt32
- #send_preface
- #stream(id)
- #stream
- #write_frame(frame : Frames)
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))
#
def self.new(socket : IO, initial_window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window), window_size : Atomic(UInt32) = Atomic(UInt32).new(local_window))
#