Gio.NetworkService¶
class — extends GObject.Object, SocketConnectable
Like NetworkAddress does with hostnames, GNetworkService
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.
See SrvTarget for more information about SRV records, and see
SocketConnectable for an example of using the connectable
interface.
Constructors¶
new¶
Creates a new NetworkService representing the given service,
protocol, and domain. This will initially be unresolved; use the
SocketConnectable interface to resolve it.
Parameters:
service— the service type to look up (eg, "ldap")protocol— the networking protocol to use forservice(eg, "tcp")domain— the DNS domain to look up the service in
Methods¶
get_domain¶
Gets the domain that srv serves. This might be either UTF-8 or
ASCII-encoded, depending on what srv was created with.
get_protocol¶
Gets srv's protocol name (eg, "tcp").
get_scheme¶
Gets the URI scheme used to resolve proxies. By default, the service name is used as scheme.
get_service¶
Gets srv's service name (eg, "ldap").
set_scheme¶
Set's the URI scheme used to resolve proxies. By default, the service name is used as scheme.
Parameters:
scheme— a URI scheme
Properties¶
domain¶
Network domain, for example example.com.
protocol¶
Network protocol, for example tcp.
scheme¶
Network scheme (default is to use service).
service¶
Service name, for example ldap.