Xirsys.Sockets.Connection (xturn_sockets v2.2.1)
View SourcePer-connection process: owns accumulator state and fully drains after each read.
Started by Acceptor via SockSupervisor. One process per accepted stream
(TCP/TLS). Datagrams use DatagramServer instead.
Internal API. Started by the library acceptor; host applications normally configure pipelines on listeners rather than starting this GenServer directly.
What problem this solves
Stream sockets need a dedicated process to hold per-connection accumulator and
handler state, re-arm {active, N} reads, and drain the full pipeline after
every chunk so partial STUN/TURN frames never stall the acceptor.
RFCs
Summary
Functions
Temporary child spec so a dead connection is not restarted.
Starts a connection process for an already-accepted socket.
Functions
Temporary child spec so a dead connection is not restarted.
Parameters
opts- same keyword list asstart_link/1
Starts a connection process for an already-accepted socket.
Parameters
opts is a keyword list:
:transport-Xirsys.Sockets.Transportmodule (required):socket- accepted client socket (required):pipeline- pipeline module, or omit and pass:accumulator+:handler:listener- acceptor pid:assigns- map copied ontoConn:handler_state- initial handler state whenhandle_connect/1is absent:tick_interval_ms- optional drain tick for reorder timeouts