gio.network_address

Module for [NetworkAddress] class

Types 3

gio.network_address.NetworkAddress provides an easy way to resolve a hostname and then attempt to connect to that host, handling the possibility of multiple IP addresses and multiple address families.

The enumeration results of resolved addresses may be cached as long as this object is kept alive which may have unexpected results if alive for too long.

See gio.socket_connectable.SocketConnectable for an example of using the connectable interface.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
NetworkAddress self() nothrowReturns `this`, for use in `with` statements.
NetworkAddressGidBuilder builder() static nothrowGet builder for [gio.network_address.NetworkAddress] Returns: New builder object
string hostname() @property nothrowGet `hostname` property. Returns: Hostname to resolve.
uint port() @property nothrowGet `port` property. Returns: Network port.
string scheme() @property nothrowGet `scheme` property. Returns: URI scheme.
gio.network_address.NetworkAddress newLoopback(ushort port) static nothrowCreates a new #GSocketConnectable 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 IPv...
gio.network_address.NetworkAddress parse(string hostAndPort, ushort defaultPort) staticCreates a new #GSocketConnectable for connecting to the given hostname and port. May fail and return null in case parsing host_and_port fails.
gio.network_address.NetworkAddress parseUri(string uri, ushort defaultPort) staticCreates a new #GSocketConnectable for connecting to the given uri. May fail and return null in case parsing uri fails.
string getHostname() nothrowGets addr's hostname. This might be either UTF-8 or ASCII-encoded, depending on what addr was created with. Returns: addr's hostname
ushort getPort() nothrowGets addr's port number Returns: addr's port (which may be 0)
string getScheme() nothrowGets addr's scheme Returns: addr's scheme (null if not built from URI)
Constructors
this(void * ptr, Flag!"Take" take)
this(string hostname, ushort port)Creates a new #GSocketConnectable for connecting to the given hostname and port.

Fluent builder implementation template for gio.network_address.NetworkAddress

Methods
T hostname(string propval) nothrowSet `hostname` property. Params: propval = Hostname to resolve. Returns: Builder instance for fluent chaining
T port(uint propval) nothrowSet `port` property. Params: propval = Network port. Returns: Builder instance for fluent chaining
T scheme(string propval) nothrowSet `scheme` property. Params: propval = URI scheme. Returns: Builder instance for fluent chaining
Methods
NetworkAddress build() nothrowCreate object from builder. Returns: New object