Socket.Protocol protocol (socket2 v2.1.2)
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
@type t() :: term()
All the types that implement this protocol.
Functions
accept(self, options \\ [])
Accept a connection from the socket.
active(self)
Make the socket active.
active(self, mode)
Make the socket active once.
close(self)
Close the socket.
equal?(self, other)
Check the two sockets are the same.
local(self)
@spec local(t()) :: {:ok, {Socket.Address.t(), :inet.port_number()}} | {:error, term()}
Get the local address/port of the socket.
options(self, opts)
Set options for the socket.
packet(self, type)
Change the packet type of the socket.
passive(self)
Make the socket passive.
process(self, pid)
Change the controlling process of the socket.
remote(self)
@spec remote(t()) :: {:ok, {Socket.Address.t(), :inet.port_number()}} | {:error, term()}
Get the remote address/port of the socket.