Socket.Stream.Protocol protocol (socket v2.0.1)
Summary
Functions
Close the socket.
Send a file through the socket, using non-copying operations where available.
Receive data from the socket compatible with the packet type.
Receive data from the socket with the given length or options.
Receive data from the socket with the given length and options.
Send data through the socket.
Shutdown the socket in the given mode, either :both
, :read
, or :write
.
Types
@type t() :: term()
Functions
close(self)
Close the socket.
file(self, path, options \\ [])
Send a file through the socket, using non-copying operations where available.
recv(self)
Receive data from the socket compatible with the packet type.
recv(self, length_or_options)
@spec recv(t(), non_neg_integer() | Keyword.t()) :: {:ok, term()} | {:error, term()}
Receive data from the socket with the given length or options.
recv(self, length, options)
@spec recv(t(), non_neg_integer(), Keyword.t()) :: {:ok, term()} | {:error, term()}
Receive data from the socket with the given length and options.
send(self, data)
Send data through the socket.
shutdown(self, how \\ :both)
Shutdown the socket in the given mode, either :both
, :read
, or :write
.