webtransport_h3_router (webtransport v0.3.0)
View SourcePer-H3-connection router for WebTransport extension events.
Owns claimed-stream and HTTP-datagram events emitted by quic_h3 for one H3 connection, and demultiplexes them to the right WebTransport session by the session-id varint that prefixes each stream / quarter-stream-id that prefixes each datagram.
Summary
Functions
Connect to an H3 server. The router becomes the H3 connection owner.
Return the H3 connection pid, or undefined if not yet connected.
Open a client-initiated WT bidi stream, sending the session-id header atomically.
Register a session pid for the given session ID.
Set or clear the passthrough pid for unhandled H3 events.
Start an unlinked router with the given passthrough target.
Start a router with no passthrough target.
Start a linked router, forwarding unhandled H3 events to Passthrough.
Remove the session registration for the given session ID.
Functions
-spec client_connect(pid(), string() | binary() | inet:ip_address(), inet:port_number(), map()) -> {ok, pid()} | {error, term()}.
Connect to an H3 server. The router becomes the H3 connection owner.
Return the H3 connection pid, or undefined if not yet connected.
-spec open_bidi_stream(pid(), non_neg_integer()) -> {ok, non_neg_integer()} | {error, term()}.
Open a client-initiated WT bidi stream, sending the session-id header atomically.
-spec register_session(pid(), non_neg_integer(), pid()) -> ok.
Register a session pid for the given session ID.
Set or clear the passthrough pid for unhandled H3 events.
Start an unlinked router with the given passthrough target.
-spec start_link() -> {ok, pid()}.
Start a router with no passthrough target.
Start a linked router, forwarding unhandled H3 events to Passthrough.
-spec unregister_session(pid(), non_neg_integer()) -> ok.
Remove the session registration for the given session ID.