socket v0.3.9 Socket.Protocol protocol

Summary

Functions

Accept a connection from the socket

Make the socket active

Make the socket active once

Close the socket

Check the two sockets are the same

Get the local address/port of the socket

Set options for the socket

Change the packet type of the socket

Make the socket passive

Change the controlling process of the socket

Get the remote address/port of the socket

Types

t()
t() :: term

Functions

accept(self, options \\ [])
accept(t, Keyword.t) :: {:ok, t} | {:error, term}

Accept a connection from the socket.

active(self)
active(t) :: :ok | {:error, term}

Make the socket active.

active(self, mode)
active(t, :once) :: :ok | {:error, term}

Make the socket active once.

close(self)
close(t) :: :ok | {:error, term}

Close the socket.

equal?(self, other)
equal?(t, t) :: boolean

Check the two sockets are the same.

local(self)
local(t) ::
  {:ok, {Socket.Address.t, :inet.port_number}} |
  {:error, term}

Get the local address/port of the socket.

options(self, opts)
options(t, Keyword.t) :: :ok | {:error, term}

Set options for the socket.

packet(self, type)
packet(t, atom) :: :ok | {:error, term}

Change the packet type of the socket.

passive(self)
passive(t) :: :ok | {:error, term}

Make the socket passive.

process(self, pid)
process(t, pid) :: :ok | {:error, term}

Change the controlling process of the socket.

remote(self)
remote(t) ::
  {:ok, {Socket.Address.t, :inet.port_number}} |
  {:error, term}

Get the remote address/port of the socket.