nquic_receiver_sup (nquic v1.0.0)

View Source

Receiver supervisor.

Holds N nquic_receiver processes under one_for_one. Each receiver owns one UDP socket. When N > 1 the receivers bind with SO_REUSEPORT so the kernel distributes incoming datagrams across sockets by 4-tuple hash.

Started as the last child of nquic_listener_sup. By the time init/1 runs the listener manager is already alive and has published itself to the dispatch table, so the receiver child specs can carry the resolved manager pid (listener opt) without extra round-trips.

Summary

Functions

Start the receiver supervisor. Args carries the dispatch handle and resolved opts.

Functions

init/1

-spec init(map()) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.

start_link(Args)

-spec start_link(#{dispatch := nquic_dispatch:t(), opts := map()}) ->
                    {ok, pid()} | ignore | {error, term()}.

Start the receiver supervisor. Args carries the dispatch handle and resolved opts.