Xirsys.XTurn.Allocate.TcpRegistry (xturn v2.0.0)

Copy Markdown View Source

ETS registries for RFC 6062 TCP relay connection ids and spliced sockets.

What problem this solves

TCP relay uses CONNECTION-ID to tie Connect, ConnectionBind, and ConnectionAttempt to the owning allocation. After ConnectionBind splices client and peer TCP sockets, the STUN framer must stop processing those ports as TURN control.

Internal note

Updated by Allocate.Client during Connect/Bind/splice.

RFCs

Summary

Functions

Resolves a CONNECTION-ID to its allocation pid.

Records that socket has been spliced to a peer TCP connection. Returns :ok.

Registers connection_id to the owning allocation alloc_pid. Returns :ok.

Removes a CONNECTION-ID registration. Returns :ok.

Functions

lookup_alloc(connection_id)

Resolves a CONNECTION-ID to its allocation pid.

Returns {:ok, pid} or :error.

mark_spliced(socket)

Records that socket has been spliced to a peer TCP connection. Returns :ok.

register(connection_id, alloc_pid)

Registers connection_id to the owning allocation alloc_pid. Returns :ok.

unregister(connection_id)

Removes a CONNECTION-ID registration. Returns :ok.