Xirsys.XTurn.RelayIngress.Worker (xturn v2.0.0)

Copy Markdown View Source

GenServer shard that owns relay UDP sockets and delivers peer packets to clients.

What problem this solves

Each relay ingress worker processes datagrams from peers that hit allocated relay ports. For each packet it verifies CreatePermission, wraps payload as ChannelData or a Data indication, and sends to the client socket. ICMP errors on relay sockets become STUN error indications to the client.

Uses active UDP with a bounded drain (udp_active_n - 1 extra messages per wakeup) to batch work without starving other processes.

Internal

One worker per shard under RelayIngress; not part of the public API.

RFCs

  • RFC 5766 - permissions, Data indication, ChannelData (pt.8-11)
  • RFC 5389 - ICMP error indication encoding

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts worker shard index registered at via(index).

Registered atom name for shard index.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(index)

Starts worker shard index registered at via(index).

via(index)

Registered atom name for shard index.