Xirsys.Sockets.Acceptor (xturn_sockets v2.2.1)
View SourceAccept loop for connection-oriented transports (TCP, TLS, DTLS).
What problem this solves
TURN-over-TCP and TURNS need a long-lived listener that accepts client
connections and hands each socket to a dedicated Connection process under
SockSupervisor. This GenServer listens, accepts with a timeout, transfers
socket ownership, then re-arms {active, :once} on the child so TLS 1.3
application data is not delivered to the acceptor.
Transport.SCTP.accept/2 is not supported by this loop.
RFCs
- RFC 8656 - TURN (client/server over TCP/TLS)
- No STUN/TURN RFC for accept loops; OTP process supervision applies
Summary
Functions
Returns a specification to start this module under a supervisor.
Bound port of a running acceptor (useful when :port was 0).
Listens and starts accepting.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Bound port of a running acceptor (useful when :port was 0).
Parameters
pid- acceptor pid fromstart_link/1
Listens and starts accepting.
Parameters
opts is a keyword list:
:transport-Xirsys.Sockets.Transportmodule (required):ip/:port- bind address (required):pipeline- pipeline module, or omit and pass:accumulator+:handler:listen_opts- extra options forwarded tolisten/3:assigns- map copied onto eachConn:accept_timeout- accept wait in milliseconds (default1000):connection_supervisor-SockSupervisorname or pid (defaultSockSupervisor)