Certificate-based QUIC v1 reliable streams with bounded pull consumption.
See docs/quic/consumer-contract.md for ownership, generation handles, deadlines,
admission outcomes and limitations. ALPN is metadata; application protocols
are provided by consumers.
Endpoints created with listen/1 or client/1 accept idle_timeout as
positive milliseconds (default 30_000) or :infinity. The latter advertises
a disabled local idle limit; both endpoints must disable their limits to avoid
a finite idle timer. A peer's finite limit still applies. Handshake, operation,
closing and draining deadlines remain finite. info/1 and ready metadata expose
idle_timeout with local_ms, peer_ms, negotiated_ms, and effective_ms
(milliseconds or :infinity); the effective period includes a three-PTO floor.
Callers can use ping/2 at a finite cadence below the peer limit. Admission is
not a peer ACK, and repeated sends without processing peer packets cannot
postpone local idle expiry indefinitely. No automatic keepalive task is created.
Summary
Functions
Admit explicit migration of an exclusive standalone client; reconcile the retained ref.
Open a locally initiated stream.
Admit one QUIC PING for caller-managed keepalive.
Reset the send direction while guaranteeing delivery of the admitted prefix.
Types
Functions
@spec accept(pid(), non_neg_integer() | operation_options()) :: {:ok, Quic.Runtime.ConnectionHandle.t()} | failure()
@spec capabilities() :: %{
datagram: true,
delivery: :pull,
http3: false,
io: [:external | :standalone, ...],
max_write_bytes: 16384,
migration: %{peer: [:server, ...], local: [:client, ...]},
resumption: true,
streams: [:bidi | :uni, ...],
version: 1
}
@spec client(keyword()) :: GenServer.on_start()
@spec close( Quic.Runtime.ConnectionHandle.t(), non_neg_integer(), binary(), operation_options() ) :: :ok | failure()
@spec connect(pid(), {:inet.ip_address(), :inet.port_number()}, operation_options()) :: {:ok, Quic.Runtime.ConnectionHandle.t()} | failure()
@spec events(Quic.Runtime.ConnectionHandle.t(), pos_integer(), operation_options()) :: {:ok, list()} | failure()
@spec listen(keyword()) :: GenServer.on_start()
@spec local(pid()) :: {:inet.ip_address(), :inet.port_number()} | {:error, term()}
@spec migrate(Quic.Runtime.ConnectionHandle.t(), operation_options()) :: {:ok, reference()} | failure()
Admit explicit migration of an exclusive standalone client; reconcile the retained ref.
@spec open_stream( Quic.Runtime.ConnectionHandle.t(), :bidi | :uni, operation_options() ) :: {:ok, Quic.Runtime.StreamHandle.t()} | failure()
Open a locally initiated stream.
reliable_prefix: bytes declares the first bytes of the send direction as
a reliable prefix. When both endpoints negotiated reliable reset
(reset_stream_at), a peer STOP_SENDING is answered with RESET_STREAM_AT
carrying the STOP_SENDING code and a reliable size equal to the admitted part
of that prefix. Without negotiation, or with a zero prefix, the answer is an
ordinary RESET_STREAM.
@spec ping(Quic.Runtime.ConnectionHandle.t(), operation_options()) :: {:ok, reference()} | failure()
Admit one QUIC PING for caller-managed keepalive.
Uses the same finite operation deadlines, deduplication, bounded send queue and
recovery as stream sends. {:ok, ref} reports admission, not peer receipt or ACK.
Choose a finite cadence below the peer's advertised idle limit, available in
info/1. Sending without successfully processing peer packets cannot postpone
local idle expiry indefinitely. No periodic task or timer is created.
@spec read(Quic.Runtime.StreamHandle.t(), pos_integer(), operation_options()) :: {:ok, list()} | failure()
@spec read_datagrams( Quic.Runtime.ConnectionHandle.t(), pos_integer(), operation_options() ) :: {:ok, [binary()]} | failure()
@spec ready(Quic.Runtime.ConnectionHandle.t()) :: :ready | :pending | failure()
@spec reset_stream( Quic.Runtime.StreamHandle.t(), non_neg_integer(), operation_options() ) :: {:ok, reference()} | failure()
@spec reset_stream_at( Quic.Runtime.StreamHandle.t(), non_neg_integer(), non_neg_integer(), operation_options() ) :: {:ok, reference()} | failure()
Reset the send direction while guaranteeing delivery of the admitted prefix.
@spec send_datagram(Quic.Runtime.ConnectionHandle.t(), binary(), operation_options()) :: {:ok, reference()} | failure()
@spec send_stream( Quic.Runtime.StreamHandle.t(), binary(), boolean(), operation_options() ) :: {:ok, reference()} | failure()
@spec stop_stream( Quic.Runtime.StreamHandle.t(), non_neg_integer(), operation_options() ) :: {:ok, reference()} | failure()