QuicHttp3.Control (elixir_quic_http3 v0.16.0)

View Source

HTTP/3 control-stream state and SETTINGS handling.

The state machine is transport-agnostic. Callers provide received stream bytes and send the returned encoded bytes through QuicHttp3.Transport.

Summary

Functions

Return the local control stream type and SETTINGS bytes without stream-id validation.

Receive bytes from an opaque peer control-stream handle.

Types

event()

@type event() ::
  {:settings, [QuicHttp3.Settings.setting()]} | {:goaway, non_neg_integer()}

t()

@type t() :: %QuicHttp3.Control{
  buffer: binary(),
  control_stream_id: non_neg_integer() | nil,
  goaway_id: non_neg_integer() | nil,
  local_open?: boolean(),
  local_settings: [QuicHttp3.Settings.setting()],
  peer_control_stream_id: term() | nil,
  peer_open?: boolean(),
  peer_settings: [QuicHttp3.Settings.setting()] | nil,
  peer_type_buffer: binary(),
  received_settings?: boolean(),
  role: :client | :server
}

Functions

local_payload(state)

@spec local_payload(t()) :: binary()

Return the local control stream type and SETTINGS bytes without stream-id validation.

new(role, settings \\ [{1, 0}, {6, 0}, {7, 0}])

@spec new(:client | :server, QuicHttp3.Settings.settings()) ::
  {:ok, t()} | {:error, term()}

open(state, stream_id)

@spec open(t(), non_neg_integer()) :: {:ok, t(), binary()} | {:error, term()}

receive(state, stream_id, bytes)

@spec receive(t(), non_neg_integer(), binary()) ::
  {:ok, t(), [event()]} | {:error, term()}

receive_peer(state, stream_key, bytes)

@spec receive_peer(t(), term(), binary()) :: {:ok, t(), [event()]} | {:error, term()}

Receive bytes from an opaque peer control-stream handle.