class

HT2::Connection

Inherits Reference < Object

Constructors

new(socket : IO, is_server : Bool = true, client_ip : String | Nil = nil)
Source

Instance methods

adaptive_buffer_manager
Source
applied_settings
Source
apply_remote_settings(settings : SettingsFrame::Settings) : Nil
Source
apply_remote_settings_frame(frame : SettingsFrame) : Nil
Source
backpressure_manager
Source
buffer_pool
Source
clear_stream_traces

Clear all stream lifecycle traces

Source
close
Source
closed?
Source
consume_window(size : Int32) : Nil
Source
create_stream(stream_id : UInt32) : Stream

Create a stream with a specific ID (used for h2c upgrade)

Source
create_stream
Source
dump_state

Dump comprehensive connection state for debugging

Source
enable_stream_tracing(enabled : Bool) : Nil

Enable or disable stream lifecycle tracing

Source
frame_cache
Source
goaway_received?
Source
goaway_sent?
Source
hpack_decoder
Source
hpack_encoder
Source
is_server?
Source
is_stream_closed?(stream_id : UInt32) : Bool

Check if a stream is closed (public for testing)

Source
last_stream_id
Source
local_settings
Source
mark_stream_closed(stream_id : UInt32) : Nil
Source
metrics
Source
on_data
Source
on_data=(on_data : DataCallback | Nil)
Source
on_headers
Source
on_headers=(on_headers : HeaderCallback | Nil)
Source
performance_metrics
Source
ping(data : Bytes | Nil = nil) : Channel(Nil)
Source
record_request

Increment request count and check for recycling

Source
remote_settings
Source
send_data_frames(stream_id : UInt32, data_chunks : Array(Bytes), end_stream : Bool = false) : Nil

Send multiple DATA frames from the same stream efficiently

Source
send_frame(frame : Frame) : Nil
Source
send_frames(frames : Array(Frame)) : Nil

Send multiple frames efficiently using batched I/O

Source
send_frames_vectored(frames : Array(Frame)) : Nil

Send multiple frames using direct vectored I/O without buffering This is most efficient when frames are already serialized or when sending many small frames that would benefit from atomic writes

Source
send_goaway(error_code : ErrorCode, debug_data : String = "") : Nil
Source
send_prioritized_frames(frames : Array(MultiFrameWriter::PrioritizedFrame)) : Nil

Send prioritized frames in priority order

Source
should_recycle?

Check if connection should be recycled for state isolation

Source
socket
Source
start
Source
start_without_preface

Start connection without reading/sending preface (used for h2c upgrade)

Source
stream_lifecycle_report

Get stream lifecycle report

Source
stream_lifecycle_tracer
Source
stream_trace(stream_id : UInt32) : String

Get detailed trace for a specific stream

Source
stream_tracing_enabled?

Check if stream lifecycle tracing is enabled

Source
streams
Source
update_settings(settings : SettingsFrame::Settings) : Channel(Nil)
Source
window_size
Source

Nested types