TCP listener for one PeerNet instance. Accepts inbound connections and
spawns one PeerNet.Connection per accepted socket.
The acceptor is intentionally tiny — all the state lives on the
per-connection process. The acceptor's only job is to call
:gen_tcp.accept/1 in a loop and hand each accepted socket off to a
fresh connection process.
Bind on port 0 to let the OS pick an ephemeral port; read it back with
port/1 afterwards (used in tests and in places where the listener's
address needs to be advertised externally).
Summary
Functions
Returns a specification to start this module under a supervisor.
Return the OS-assigned listen port (resolved from port: 0).
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec port(GenServer.server()) :: :inet.port_number()
Return the OS-assigned listen port (resolved from port: 0).