Xirsys.Sockets.Acceptor (xturn_sockets v2.2.0)

View Source

Accept loop for connection-oriented transports (TCP, TLS).

Each accepted socket is started under SockSupervisor as a Connection. Transport.SCTP.accept/2 is not supported by this loop.

Summary

Functions

Returns a specification to start this module under a supervisor.

Bound port of a running acceptor (useful when :port was 0).

Listens and starts accepting.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

port(pid)

Bound port of a running acceptor (useful when :port was 0).

Parameters

start_link(opts)

Listens and starts accepting.

Parameters

opts is a keyword list:

  • :transport - Xirsys.Sockets.Transport module (required)
  • :ip / :port - bind address (required)
  • :pipeline - pipeline module, or omit and pass :accumulator + :handler
  • :listen_opts - extra options forwarded to listen/3
  • :assigns - map copied onto each Conn
  • :accept_timeout - accept wait in milliseconds (default 1000)
  • :connection_supervisor - SockSupervisor name or pid (default SockSupervisor)