Quic.Streams (elixir_quic v0.16.7)

Copy Markdown View Source

Connection-owned QUIC stream state.

Stream values are data references; this module creates no processes. All peer-controlled offsets and buffering are checked against the configured limits before bytes are retained.

Summary

Functions

Consume queued stream events when delivery: :manual is configured.

Install authenticated peer transport parameters into stream send limits.

Open a locally initiated stream and return its stable stream id.

Apply a peer STOP_SENDING to the local send direction.

Process one authenticated STREAM frame and emit newly contiguous bytes.

Apply a peer RESET_STREAM, admitting a previously unseen peer stream.

Reset the local send direction at its admitted final size.

Admit bytes to a stream send queue; returned frame can be packetized.

Return coalesced receive-credit frames and clear their pending state.

Types

initial_state()

@type initial_state() :: %Quic.Streams{
  blocked: MapSet.t(),
  data_consumed: 0,
  data_delivered: 0,
  data_received: 0,
  data_sent: 0,
  delivery: :immediate | :manual,
  max_buffer: term(),
  max_data: term(),
  max_local_stream_records: number(),
  max_peer_stream_records: number(),
  max_ready_bytes: term(),
  max_recv_ranges: term(),
  max_stream_data: term(),
  max_stream_data_bidi_local: term(),
  max_stream_data_bidi_remote: term(),
  max_stream_data_uni: term(),
  max_stream_records: number(),
  max_streams_bidi: number(),
  max_streams_uni: number(),
  next_local_bidi: 0,
  next_local_uni: 0,
  peer_max_data: term(),
  peer_max_stream_data: term(),
  peer_max_stream_data_bidi_local: term(),
  peer_max_stream_data_bidi_remote: term(),
  peer_max_stream_data_uni: term(),
  peer_max_streams_bidi: term(),
  peer_max_streams_uni: term(),
  pending_credit: %{},
  ready: %{},
  ready_bytes: 0,
  role: :client | :server,
  streams: %{}
}

t()

@type t() :: %Quic.Streams{
  blocked: MapSet.t(),
  data_consumed: term(),
  data_delivered: term(),
  data_received: term(),
  data_sent: term(),
  delivery: term(),
  max_buffer: term(),
  max_data: term(),
  max_local_stream_records: term(),
  max_peer_stream_records: term(),
  max_ready_bytes: term(),
  max_recv_ranges: term(),
  max_stream_data: term(),
  max_stream_data_bidi_local: term(),
  max_stream_data_bidi_remote: term(),
  max_stream_data_uni: term(),
  max_stream_records: term(),
  max_streams_bidi: term(),
  max_streams_uni: term(),
  next_local_bidi: term(),
  next_local_uni: term(),
  peer_max_data: term(),
  peer_max_stream_data: term(),
  peer_max_stream_data_bidi_local: term(),
  peer_max_stream_data_bidi_remote: term(),
  peer_max_stream_data_uni: term(),
  peer_max_streams_bidi: term(),
  peer_max_streams_uni: term(),
  pending_credit: term(),
  ready: term(),
  ready_bytes: term(),
  role: term(),
  streams: term()
}

Functions

consume(state, id, max_bytes)

Consume queued stream events when delivery: :manual is configured.

install_peer_parameters(state, values)

Install authenticated peer transport parameters into stream send limits.

new(role, opts \\ [])

@spec new(:client | :server, keyword()) :: initial_state()

open(state, kind)

Open a locally initiated stream and return its stable stream id.

peer_stop_sending(state, id, error_code)

Apply a peer STOP_SENDING to the local send direction.

receive(state, arg2)

Process one authenticated STREAM frame and emit newly contiguous bytes.

receive_reset(state, id, error_code, final_size)

Apply a peer RESET_STREAM, admitting a previously unseen peer stream.

reset(state, id, error_code, final_size)

reset_send(state, id, error_code)

Reset the local send direction at its admitted final size.

send(state, id, data, fin \\ false)

Admit bytes to a stream send queue; returned frame can be packetized.

stop_sending(state, id, error_code)

stream(state, id)

take_credit(state)

Return coalesced receive-credit frames and clear their pending state.

update_credit(state, arg2)