quic_dist (quic v0.11.0)
View SourceErlang distribution protocol implementation over QUIC.
This module implements the Erlang distribution protocol callbacks using QUIC as the transport layer. It provides:
- Connection establishment via TLS 1.3 (built into QUIC) - Multiple streams for parallel message delivery - Head-of-line blocking avoidance - Connection migration for NAT traversal - 0-RTT reconnection for fast session resumption
Configuration
Enable QUIC distribution in vm.args:
-proto_dist quic
-epmd_module quic_epmd
-start_epmd falseConfigure in sys.config:
{quic, [
{dist, [
{cert_file, "/path/to/cert.pem"},
{key_file, "/path/to/key.pem"},
{cacert_file, "/path/to/ca.pem"},
{verify, verify_peer}
]}
]}
Summary
Functions
Accept a connection from the distribution listener.
Handle an accepted connection. Called by net_kernel when a new connection is accepted.
Return the address family to use.
Close the distribution listener.
Check if a node name is valid.
Start listening for incoming distribution connections.
Start listening with options.
Check if this distribution module should be used for the given node. Returns true if the node name is valid and we can potentially connect.
Set up an outgoing distribution connection. Called by net_kernel to establish a connection to another node.
Functions
Accept a connection from the distribution listener.
-spec accept_connection(AcceptPid :: pid(), Socket :: term(), MyNode :: node(), Allowed :: term(), SetupTime :: non_neg_integer()) -> pid().
Handle an accepted connection. Called by net_kernel when a new connection is accepted.
-spec address() -> #net_address{address :: term(), host :: term(), protocol :: term(), family :: term()}.
Return the address family to use.
-spec close(Listen :: term()) -> ok.
Close the distribution listener.
Check if a node name is valid.
-spec listen(Name :: atom()) -> {ok, {LSocket :: term(), TcpAddress :: term(), Creation :: non_neg_integer()}} | {error, Reason :: term()}.
Start listening for incoming distribution connections.
-spec listen(Name :: atom(), Opts :: map()) -> {ok, {LSocket :: term(), TcpAddress :: term(), Creation :: non_neg_integer()}} | {error, Reason :: term()}.
Start listening with options.
Check if this distribution module should be used for the given node. Returns true if the node name is valid and we can potentially connect.
-spec setup(Node :: node(), Type :: atom(), MyNode :: node(), LongOrShortNames :: shortnames | longnames, SetupTime :: non_neg_integer()) -> pid().
Set up an outgoing distribution connection. Called by net_kernel to establish a connection to another node.