GSMLG.Socket.Host (GSMLG.Socket v0.1.0)

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

@type t() :: %GSMLG.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)

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

Get the hostent by address.

Link to this function

by_address!(address)

@spec by_address!(GSMLG.Socket.Address.t()) :: t() | no_return()

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

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

Get the hostent by name.

Link to this function

by_name(name, family)

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

Get the hostent by name and family.

@spec by_name!(binary()) :: t() | no_return()

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

Link to this function

by_name!(name, family)

@spec by_name!(binary() | charlist(), :inet.address_family()) :: t() | no_return()

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

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

Get the interfaces of the machine.

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

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

@spec name() :: String.t()

Get the hostname of the machine.