GSMLG.Socket.Protocol protocol (GSMLG.Socket v0.1.0)

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

@type t() :: term()

Link to this section Functions

Link to this function

accept(self, options \\ [])

@spec accept(t(), Keyword.t()) :: {:ok, t()} | {:error, term()}

Accept a connection from the socket.

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

Make the socket active.

Link to this function

active(self, mode)

@spec active(t(), :once) :: :ok | {:error, term()}

Make the socket active once.

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

Close the socket.

Link to this function

equal?(self, other)

@spec equal?(t(), t()) :: boolean()

Check the two sockets are the same.

@spec 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)

@spec options(t(), Keyword.t()) :: :ok | {:error, term()}

Set options for the socket.

Link to this function

packet(self, type)

@spec packet(t(), atom()) :: :ok | {:error, term()}

Change the packet type of the socket.

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

Make the socket passive.

Link to this function

process(self, pid)

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

Change the controlling process of the socket.

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

Get the remote address/port of the socket.