FixAlchemy.Transport (FIXAlchemy v0.2.2)
View SourceSocket operations over plain TCP or TLS, chosen by an atom.
A transport is :gen_tcp or :ssl. Every function takes it as its first
argument, so a session holds the atom in its state and never branches on it.
Sockets are opened in active: :once mode. A caller that has finished
handling a delivered packet calls activate_once/2 to ask for the next one.
Summary
Functions
Accept one connection, completing the TLS handshake when the transport is
:ssl.
The transport an option set selects; tls: true selects :ssl.
Open a listening socket on port.
Types
@type socket() :: :gen_tcp.socket() | :ssl.sslsocket()
@type t() :: :gen_tcp | :ssl
Functions
Accept one connection, completing the TLS handshake when the transport is
:ssl.
The returned socket belongs to the calling process until it hands it on with
controlling_process/3.
The transport an option set selects; tls: true selects :ssl.
@spec listen(t(), :inet.port_number(), keyword()) :: {:ok, socket()} | {:error, term()}
Open a listening socket on port.
port may be 0 to let the operating system choose one; read it back with
listen_port/2.
@spec listen_port(t(), socket()) :: {:ok, :inet.port_number()} | {:error, term()}
@spec peername(t(), socket()) :: {:ok, {:inet.ip_address(), :inet.port_number()}} | {:error, term()}