Class: Gio::NetworkAddress
- Inherits:
-
Object
- Object
- Gio::NetworkAddress
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#hostname ⇒ String
Hostname.
- #hostname=(hostname) ⇒ String
-
#new(hostname, port) ⇒ Gio::NetworkAddress
Creates a new GSocket::Connectable for connecting to the given hostname and port.
-
#new_loopback(port) ⇒ Gio::NetworkAddress
Creates a new GSocket::Connectable for connecting to the local host over a loopback connection to the given port.
-
#port ⇒ Integer
Port.
- #port=(port) ⇒ Integer
-
#scheme ⇒ String
Scheme.
- #scheme=(scheme) ⇒ String
Instance Method Details
#hostname ⇒ String
Returns hostname.
#hostname=(hostname) ⇒ String
#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.
#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.
#port ⇒ Integer
Returns port.
#port=(port) ⇒ Integer
#scheme ⇒ String
Returns scheme.