socket v0.3.13 Socket.Protocol protocol

Link to this section 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

Link to this section Types

Link to this section Functions

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

Accept a connection from the socket.

Link to this function active(self)
active(t()) :: :ok | {:error, term()}

Make the socket active.

Link to this function active(self, mode)
active(t(), :once) :: :ok | {:error, term()}

Make the socket active once.

Link to this function close(self)
close(t()) :: :ok | {:error, term()}

Close the socket.

Link to this function equal?(self, other)
equal?(t(), t()) :: boolean()

Check the two sockets are the same.

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

Get the local address/port of the socket.

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

Set options for the socket.

Link to this function packet(self, type)
packet(t(), atom()) :: :ok | {:error, term()}

Change the packet type of the socket.

Link to this function passive(self)
passive(t()) :: :ok | {:error, term()}

Make the socket passive.

Link to this function process(self, pid)
process(t(), pid()) :: :ok | {:error, term()}

Change the controlling process of the socket.

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

Get the remote address/port of the socket.