Method

GioSocketAddressEnumeratornext

Declaration

GSocketAddress*
g_socket_address_enumerator_next (
  GSocketAddressEnumerator* enumerator,
  GCancellable* cancellable,
  GError** error
)

Description

Retrieves the next GSocketAddress from enumerator. Note that this may block for some amount of time. (Eg, a GNetworkAddress may need to do a DNS lookup before it can return an address.) Use g_socket_address_enumerator_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 g_socket_address_enumerator_next() will return an appropriate error in *error. However, if the first call to g_socket_address_enumerator_next() succeeds, then any further internal errors (other than cancellable being triggered) will be ignored.

Parameters

cancellable GCancellable
 

Optional GCancellable object, NULL to ignore.

 The argument can be NULL.
 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GSocketAddress
 

A GSocketAddress (owned by the caller), or NULL on error (in which case *error will be set) or if there are no more addresses.

 The caller of the method takes ownership of the data, and is responsible for freeing it.