Virtual Method


since: 2.60


lookup_by_name_with_flags (
  GResolver* resolver,
  const gchar* hostname,
  GResolverNameLookupFlags flags,
  GCancellable* cancellable,
  GError** error


This differs from g_resolver_lookup_by_name() in that you can modify the lookup behavior with flags. For example this can be used to limit results with G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY.

Available since: 2.60



Type: const gchar*

The hostname to look up.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Type: GResolverNameLookupFlags

Extra GResolverNameLookupFlags for the lookup.


Type: GCancellable

A GCancellable, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the virtual function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: A list of GInetAddress*

A non-empty GList of GInetAddress, or NULL on error. You must unref each of the addresses and free the list when you are done with it. (You can use g_resolver_free_addresses() to do this.)

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