Socket.Stream (socket2 v2.1.2)

Copy Markdown

Summary

Types

t()

@type t() :: Socket.Stream.Protocol.t()

Functions

close(self)

See Socket.Stream.Protocol.close/1.

close!(self)

file(self, path)

See Socket.Stream.Protocol.file/2.

file(self, path, options)

See Socket.Stream.Protocol.file/3.

file!(self, path)

file!(self, path, options)

io(self, io, options \\ [])

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

Read from the IO device and send to the socket following the given options.

Options

  • :size is the amount of bytes to read from the IO device, if omitted it will read until EOF
  • :offset is the amount of bytes to read from the IO device before starting to send what's being read
  • :chunk_size is the size of the chunks read from the IO device at a time

io!(self, io)

io!(self, io, options)

recv(self)

See Socket.Stream.Protocol.recv/1.

recv(self, length_or_options)

See Socket.Stream.Protocol.recv/2.

recv(self, length, options)

See Socket.Stream.Protocol.recv/3.

recv!(self)

recv!(self, length_or_options)

recv!(self, length, options)

send(self, data)

See Socket.Stream.Protocol.send/2.

send!(self, data)

shutdown(self)

See Socket.Stream.Protocol.shutdown/1.

shutdown(self, how)

See Socket.Stream.Protocol.shutdown/2.

shutdown!(self)

shutdown!(self, how)