socket v0.3.13 Socket.Host

Link to this section Summary

Functions

Get the hostent by address

Get the hostent by address, raising if an error occurs

Get the hostent by name

Get the hostent by name and family

Get the hostent by name, raising if an error occurs

Get the hostent by name and family, raising if an error occurs

Get the interfaces of the machine

Get the interfaces of the machine, raising if an error occurs

Get the hostname of the machine

Link to this section Types

Link to this type t()
t() :: %Socket.Host{
  aliases: [String.t()],
  length: integer(),
  list: [tuple()],
  name: String.t(),
  type: :inet | :inet6
}

Link to this section Functions

Link to this function by_address(address)
by_address(Socket.Address.t()) :: {:ok, t()} | {:error, :inet.posix()}

Get the hostent by address.

Link to this function by_address!(address)
by_address!(Socket.Address.t()) :: t() | no_return()

Get the hostent by address, raising if an error occurs.

Link to this function by_name(name)
by_name(binary()) :: {:ok, t()} | {:error, :inet.posix()}

Get the hostent by name.

Link to this function by_name(name, family)
by_name(binary(), :inet.address_family()) ::
  {:ok, t()} | {:error, :inet.posix()}

Get the hostent by name and family.

Link to this function by_name!(name)
by_name!(binary()) :: t() | no_return()

Get the hostent by name, raising if an error occurs.

Link to this function by_name!(name, family)
by_name!(binary() | charlist(), :inet.address_family()) :: t() | no_return()

Get the hostent by name and family, raising if an error occurs.

Link to this function interfaces()
interfaces() :: {:ok, [tuple()]} | {:error, :inet.posix()}

Get the interfaces of the machine.

Link to this function interfaces!()
interfaces!() :: [tuple()] | no_return()

Get the interfaces of the machine, raising if an error occurs.

Get the hostname of the machine.