Gio.NetworkAddress

const Gio = imports.gi.Gio;

let networkAddress = new Gio.NetworkAddress({
    hostname: value,
    port: value,
    scheme: value,
});
  

Gio.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.

See Gio.SocketConnectable for and example of using the connectable interface.

Hierarchy

  • GObject.Object
    • Gio.NetworkAddress