Xirsys.Sockets.SockSupervisor (xturn_sockets v2.2.1)

View Source

Dynamic supervisor for per-connection Connection processes.

What problem this solves

Each accepted TCP/TLS/DTLS client needs an isolated process with its own accumulator state and drain loop. SockSupervisor is a DynamicSupervisor that starts Connection children on demand from Acceptor.

Start this before Acceptor. Tests typically call start_link/0 once.

Internal note

OTP supervision only; no wire protocol logic lives here.

RFCs

  • RFC 8656 - TURN (one client session per connection)
  • No STUN/TURN RFC for OTP supervision

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts one Connection child under supervisor.

Starts the named connection supervisor.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_connection(supervisor \\ __MODULE__, opts)

@spec start_connection(
  atom() | pid(),
  keyword()
) :: DynamicSupervisor.on_start_child()

Starts one Connection child under supervisor.

Parameters

start_link(opts \\ [])

Starts the named connection supervisor.

Parameters