socket v0.3.9 Socket.Host

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

Types

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

Functions

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

Get the hostent by address.

by_address!(address)
by_address!(Socket.Address.t) :: t | no_return

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

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

Get the hostent by name.

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

Get the hostent by name and family.

by_name!(name)
by_name!(binary) :: t | no_return

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

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.

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

Get the interfaces of the machine.

interfaces!()
interfaces!() :: [tuple] | no_return

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

name()
name() :: String.t

Get the hostname of the machine.