Class: Gio::NetworkAddress

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#hostnameString

Returns hostname.

Returns:

  • (String)

    hostname

#hostname=(hostname) ⇒ String

Parameters:

  • hostname (String)

Returns:

  • (String)

    hostname

  • (String)

    hostname

#new(hostname, port) ⇒ Gio::NetworkAddress

Creates a new GSocket::Connectable for connecting to the given hostname and port.

Note that depending on the configuration of the machine, a hostname of ‘localhost` may refer to the IPv4 loopback address only, or to both IPv4 and IPv6; use g_network_address_new_loopback() to create a GNetwork::Address that is guaranteed to resolve to both addresses.

Parameters:

  • hostname (String)

    the hostname

  • port (Integer)

    the port

Returns:

#new_loopback(port) ⇒ Gio::NetworkAddress

Creates a new GSocket::Connectable for connecting to the local host over a loopback connection to the given port. This is intended for use in connecting to local services which may be running on IPv4 or IPv6.

The connectable will return IPv4 and IPv6 loopback addresses, regardless of how the host resolves ‘localhost`. By contrast, g_network_address_new() will often only return an IPv4 address when resolving `localhost`, and an IPv6 address for `localhost6`.

g_network_address_get_hostname() will always return ‘localhost` for a GNetwork::Address created with this constructor.

Parameters:

  • port (Integer)

    the port

Returns:

#portInteger

Returns port.

Returns:

  • (Integer)

    port

#port=(port) ⇒ Integer

Parameters:

  • port (Integer)

Returns:

  • (Integer)

    port

  • (Integer)

    port

#schemeString

Returns scheme.

Returns:

  • (String)

    scheme

#scheme=(scheme) ⇒ String

Parameters:

  • scheme (String)

Returns:

  • (String)

    scheme

  • (String)

    scheme