Gio.NetworkService

const Gio = imports.gi.Gio;

let networkService = new Gio.NetworkService({
    domain: value,
    protocol: value,
    service: value,
});
  

Like Gio.NetworkAddress does with hostnames, Gio.NetworkService 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 Gio.SrvTarget for more information about SRV records, and see Gio.SocketConnectable for and example of using the connectable interface.

Hierarchy

  • GObject.Object
    • Gio.NetworkService