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
NetworkAddress self()Returns `this`, for use in `with` statements.NetworkAddressGidBuilder builder()Get builder for [gio.network_address.NetworkAddress] Returns: New builder objectgio.network_address.NetworkAddress newLoopback(ushort port)Creates 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)Creates a new #GSocketConnectable for connecting to the given hostname and port. May fail and return null in case parsing hostandport fails.gio.network_address.NetworkAddress parseUri(string uri, ushort defaultPort)Creates a new #GSocketConnectable for connecting to the given uri. May fail and return null in case parsing uri fails.string getHostname()Gets addr's hostname. This might be either UTF-8 or ASCII-encoded, depending on what addr was created with. Returns: addr's hostnameushort getPort()Gets addr's port number Returns: addr's port (which may be 0)string getScheme()Gets addr's scheme Returns: addr's scheme (null if not built from URI)classNetworkAddressGidBuilderImpl(T) : gobject.object.ObjectWrapGidBuilderImpl!T, gio.socket_connectable.SocketConnectableGidBuilderImpl!T
Methods
T hostname(string propval)Set `hostname` property. Params: propval = Hostname to resolve. Returns: Builder instance for fluent chainingT port(uint propval)Set `port` property. Params: propval = Network port. Returns: Builder instance for fluent chainingT scheme(string propval)Set `scheme` property. Params: propval = URI scheme. Returns: Builder instance for fluent chainingFluent builder for [gio.network_address.NetworkAddress]
Methods