Sippet v0.6.2 Sippet.Transports.UDP.Plug View Source
A Sippet.Transports.Plug implementing a UDP transport.
The UDP transport consists basically in a listening process, this Plug
implementation itself, and a pool of senders, defined in
Sippet.Transports.UDP.Sender, managed by poolboy.
The start_link/0 function starts them, along a root supervisor that
monitors them all in case of failures.
This Plug process creates an UDP socket and keeps listening for datagrams
in active mode. Its job is to forward the datagrams to the processing pool
defined in Sippet.Transports.Queue. The sender processes pool keeps waiting
for SIP messages (as defined by Sippet.Message), transforms them into
iodata and dispatch them to the same UDP socket created by this Plug.
Both pools will block if all worker processes are busy, which may happen only in high load surges, as both are pure processing pools.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
This blocking function gets called only during the senders' initialization
This connection is not reliable
Send a message to the UDP senders' pool
Starts the UDP plug
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor.
get_socket() View Source
This blocking function gets called only during the senders' initialization.
reliable?() View Source
This connection is not reliable.
send_message(message, host, port, key) View Source
Send a message to the UDP senders' pool.
start_link() View Source
Starts the UDP plug.