Gio.SocketAddressEnumerator.prototype.next

function next(cancellable: Gio.Cancellable): Gio.SocketAddress {
    // Gjs wrapper for g_socket_address_enumerator_next()
}
  

Retrieves the next Gio.SocketAddress from enumerator. Note that this may block for some amount of time. (Eg, a Gio.NetworkAddress may need to do a DNS lookup before it can return an address.) Use Gio.SocketAddressEnumerator.prototype.next_async if you need to avoid blocking.

If enumerator is expected to yield addresses, but for some reason is unable to (eg, because of a DNS error), then the first call to Gio.SocketAddressEnumerator.prototype.next will return an appropriate error in *@error. However, if the first call to Gio.SocketAddressEnumerator.prototype.next succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.

cancellable

optional Gio.Cancellable object, null to ignore.

Returns

a Gio.SocketAddress (owned by the caller), or null on error (in which case *@error will be set) or if there are no more addresses.