Abyss.Transport.UDP (Abyss v0.3.2)

View Source

Defines a Abyss.Transport implementation based on clear UDP sockets as provided by Erlang's :gen_udp module. For the most part, users of Abyss will only ever need to deal with this module via transport_options passed to Abyss at startup time. A complete list of such options is defined via the :gen_udp.open_option/0 type. This list can be somewhat difficult to decipher; by far the most common value to pass to this transport is the following:

  • ip: The IP to listen on. Can be specified as:
    • {1, 2, 3, 4} for IPv4 addresses
    • {1, 2, 3, 4, 5, 6, 7, 8} for IPv6 addresses
    • :loopback for local loopback
    • :any for all interfaces (i.e.: 0.0.0.0)
    • {:local, "/path/to/socket"} for a Unix domain socket. If this option is used, the port option must be set to 0

Unless overridden, this module uses the following default options:

reuseaddr: true

The following options are required for the proper operation of Abyss and cannot be overridden:

mode: :binary,
active: false

Summary

Functions

open(port, user_options)

recv(socket, length)

See :gen_udp.recv/2.

send(socket, dest, data)

See :gen_udp.send/3.

send(socket, ip, port, data)

See :gen_udp.send/4.

send(socket, ip, port, anc_data, data)

See :gen_udp.send/5.