Xirsys.Sockets.DatagramServer (xturn_sockets v2.2.0)
View SourceDatagram listener that drains every whole packet from each inbound datagram.
Default transport is Transport.UDP. Multi-tier pipelines can keep per-peer
session state; otherwise each datagram is framed independently.
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns {server_ip, server_port} for the bound listener.
Bound port of a running server (useful when :port was 0).
Returns the listen socket owned by pid.
Opens a datagram listener.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec endpoint(pid()) :: {:inet.ip_address(), :inet.port_number()}
Returns {server_ip, server_port} for the bound listener.
Bound port of a running server (useful when :port was 0).
Parameters
pid- server pid fromstart_link/1
Returns the listen socket owned by pid.
Used when a reply must be sent from a different local endpoint than the socket that received the datagram (RFC 5780 CHANGE-REQUEST).
Opens a datagram listener.
Parameters
opts is a keyword list:
:ip/:port- bind address (required):transport- transport module (defaultTransport.UDP):pipeline- pipeline module, or omit and pass:accumulator+:handler:listen_opts- extra options forwarded tolisten/3:assigns- map copied onto each datagram'sConn:handler_state- initial handler state for stateless datagrams:tick_interval_ms- optional drain tick (also enables per-peer sessions when the pipeline has more than:root)