Xirsys.Sockets.Connection (xturn_sockets v2.2.0)

View Source

Per-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.

Summary

Functions

Temporary child spec so a dead connection is not restarted.

Starts a connection process for an already-accepted socket.

Functions

child_spec(init_arg)

Temporary child spec so a dead connection is not restarted.

Parameters

start_link(opts)

Starts a connection process for an already-accepted socket.

Parameters

opts is a keyword list:

  • :transport - Xirsys.Sockets.Transport module (required)
  • :socket - accepted client socket (required)
  • :pipeline - pipeline module, or omit and pass :accumulator + :handler
  • :listener - acceptor pid
  • :assigns - map copied onto Conn
  • :handler_state - initial handler state when handle_connect/1 is absent
  • :tick_interval_ms - optional drain tick for reorder timeouts