Class

GioResolver

Description [src]

abstract class Gio.Resolver : GObject.Object {
  parent_instance: GObject,
  priv: GResolverPrivate*
}

GResolver provides cancellable synchronous and asynchronous DNS resolution, for hostnames (g_resolver_lookup_by_address(), g_resolver_lookup_by_name() and their async variants) and SRV (service) records (g_resolver_lookup_service()).

GNetworkAddress and GNetworkService provide wrappers around GResolver functionality that also implement GSocketConnectable, making it easy to connect to a remote host/service.

Hierarchy

hierarchy this GResolver ancestor_0 GObject ancestor_0--this

Ancestors

Functions

g_resolver_free_addresses

Frees addresses (which should be the return value from g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()). (This is a convenience method; you can also simply free the results by hand.)

Available since: 2.22

g_resolver_free_targets

Frees targets (which should be the return value from g_resolver_lookup_service() or g_resolver_lookup_service_finish()). (This is a convenience method; you can also simply free the results by hand.)

Available since: 2.22

g_resolver_get_default

Gets the default GResolver. You should unref it when you are done with it. GResolver may use its reference count as a hint about how many threads it should allocate for concurrent DNS resolutions.

Available since: 2.22

Instance methods

g_resolver_lookup_by_address

Synchronously reverse-resolves address to determine its associated hostname.

Available since: 2.22

g_resolver_lookup_by_address_async

Begins asynchronously reverse-resolving address to determine its associated hostname, and eventually calls callback, which must call g_resolver_lookup_by_address_finish() to get the final result.

Available since: 2.22

g_resolver_lookup_by_address_finish

Retrieves the result of a previous call to g_resolver_lookup_by_address_async().

Available since: 2.22

g_resolver_lookup_by_name

Synchronously resolves hostname to determine its associated IP address(es). hostname may be an ASCII-only or UTF-8 hostname, or the textual form of an IP address (in which case this just becomes a wrapper around g_inet_address_new_from_string()).

Available since: 2.22

g_resolver_lookup_by_name_async

Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls callback, which must call g_resolver_lookup_by_name_finish() to get the result. See g_resolver_lookup_by_name() for more details.

Available since: 2.22

g_resolver_lookup_by_name_finish

Retrieves the result of a call to g_resolver_lookup_by_name_async().

Available since: 2.22

g_resolver_lookup_by_name_with_flags

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

g_resolver_lookup_by_name_with_flags_async

Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls callback, which must call g_resolver_lookup_by_name_with_flags_finish() to get the result. See g_resolver_lookup_by_name() for more details.

Available since: 2.60

g_resolver_lookup_by_name_with_flags_finish

Retrieves the result of a call to g_resolver_lookup_by_name_with_flags_async().

Available since: 2.60

g_resolver_lookup_records

Synchronously performs a DNS record lookup for the given rrname and returns a list of records as GVariant tuples. See GResolverRecordType for information on what the records contain for each record_type.

Available since: 2.34

g_resolver_lookup_records_async

Begins asynchronously performing a DNS lookup for the given rrname, and eventually calls callback, which must call g_resolver_lookup_records_finish() to get the final result. See g_resolver_lookup_records() for more details.

Available since: 2.34

g_resolver_lookup_records_finish

Retrieves the result of a previous call to g_resolver_lookup_records_async(). Returns a non-empty list of records as GVariant tuples. See GResolverRecordType for information on what the records contain.

Available since: 2.34

g_resolver_lookup_service

Synchronously performs a DNS SRV lookup for the given service and protocol in the given domain and returns an array of GSrvTarget. domain may be an ASCII-only or UTF-8 hostname. Note also that the service and protocol arguments do not include the leading underscore that appears in the actual DNS entry.

Available since: 2.22

g_resolver_lookup_service_async

Begins asynchronously performing a DNS SRV lookup for the given service and protocol in the given domain, and eventually calls callback, which must call g_resolver_lookup_service_finish() to get the final result. See g_resolver_lookup_service() for more details.

Available since: 2.22

g_resolver_lookup_service_finish

Retrieves the result of a previous call to g_resolver_lookup_service_async().

Available since: 2.22

g_resolver_set_default

Sets resolver to be the application’s default resolver (reffing resolver, and unreffing the previous default resolver, if any). Future calls to g_resolver_get_default() will return this resolver.

Available since: 2.22

Methods inherited from GObject (43)

Signals

Gio.Resolver::reload

Emitted when the resolver notices that the system resolver configuration has changed.

Signals inherited from GObject (1)

Class structure

struct GioResolverClass {
  GObjectClass parent_class;
  void (* reload) (
    GResolver* resolver
  );
  GList* (* lookup_by_name) (
    GResolver* resolver,
    const gchar* hostname,
    GCancellable* cancellable,
    GError** error
  );
  void (* lookup_by_name_async) (
    GResolver* resolver,
    const gchar* hostname,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  GList* (* lookup_by_name_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  );
  gchar* (* lookup_by_address) (
    GResolver* resolver,
    GInetAddress* address,
    GCancellable* cancellable,
    GError** error
  );
  void (* lookup_by_address_async) (
    GResolver* resolver,
    GInetAddress* address,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gchar* (* lookup_by_address_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  );
  GList* (* lookup_service) (
    GResolver* resolver,
    const gchar* rrname,
    GCancellable* cancellable,
    GError** error
  );
  void (* lookup_service_async) (
    GResolver* resolver,
    const gchar* rrname,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  GList* (* lookup_service_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  );
  GList* (* lookup_records) (
    GResolver* resolver,
    const gchar* rrname,
    GResolverRecordType record_type,
    GCancellable* cancellable,
    GError** error
  );
  void (* lookup_records_async) (
    GResolver* resolver,
    const gchar* rrname,
    GResolverRecordType record_type,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  GList* (* lookup_records_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  );
  void (* lookup_by_name_with_flags_async) (
    GResolver* resolver,
    const gchar* hostname,
    GResolverNameLookupFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  GList* (* lookup_by_name_with_flags_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  );
  GList* (* lookup_by_name_with_flags) (
    GResolver* resolver,
    const gchar* hostname,
    GResolverNameLookupFlags flags,
    GCancellable* cancellable,
    GError** error
  );
  
}
Class members
parent_class
GObjectClass
  No description available.
reload
void (* reload) (
    GResolver* resolver
  )
  No description available.
lookup_by_name
GList* (* lookup_by_name) (
    GResolver* resolver,
    const gchar* hostname,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
lookup_by_name_async
void (* lookup_by_name_async) (
    GResolver* resolver,
    const gchar* hostname,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
lookup_by_name_finish
GList* (* lookup_by_name_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  )
  No description available.
lookup_by_address
gchar* (* lookup_by_address) (
    GResolver* resolver,
    GInetAddress* address,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
lookup_by_address_async
void (* lookup_by_address_async) (
    GResolver* resolver,
    GInetAddress* address,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
lookup_by_address_finish
gchar* (* lookup_by_address_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  )
  No description available.
lookup_service
GList* (* lookup_service) (
    GResolver* resolver,
    const gchar* rrname,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
lookup_service_async
void (* lookup_service_async) (
    GResolver* resolver,
    const gchar* rrname,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
lookup_service_finish
GList* (* lookup_service_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  )
  No description available.
lookup_records
GList* (* lookup_records) (
    GResolver* resolver,
    const gchar* rrname,
    GResolverRecordType record_type,
    GCancellable* cancellable,
    GError** error
  )
  No description available.
lookup_records_async
void (* lookup_records_async) (
    GResolver* resolver,
    const gchar* rrname,
    GResolverRecordType record_type,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
lookup_records_finish
GList* (* lookup_records_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  )
  No description available.
lookup_by_name_with_flags_async
void (* lookup_by_name_with_flags_async) (
    GResolver* resolver,
    const gchar* hostname,
    GResolverNameLookupFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
  No description available.
lookup_by_name_with_flags_finish
GList* (* lookup_by_name_with_flags_finish) (
    GResolver* resolver,
    GAsyncResult* result,
    GError** error
  )
  No description available.
lookup_by_name_with_flags
GList* (* lookup_by_name_with_flags) (
    GResolver* resolver,
    const gchar* hostname,
    GResolverNameLookupFlags flags,
    GCancellable* cancellable,
    GError** error
  )
  No description available.

Virtual methods

Gio.ResolverClass.lookup_by_address

Synchronously reverse-resolves address to determine its associated hostname.

Available since: 2.22

Gio.ResolverClass.lookup_by_address_async

Begins asynchronously reverse-resolving address to determine its associated hostname, and eventually calls callback, which must call g_resolver_lookup_by_address_finish() to get the final result.

Available since: 2.22

Gio.ResolverClass.lookup_by_address_finish

Retrieves the result of a previous call to g_resolver_lookup_by_address_async().

Available since: 2.22

Gio.ResolverClass.lookup_by_name

Synchronously resolves hostname to determine its associated IP address(es). hostname may be an ASCII-only or UTF-8 hostname, or the textual form of an IP address (in which case this just becomes a wrapper around g_inet_address_new_from_string()).

Available since: 2.22

Gio.ResolverClass.lookup_by_name_async

Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls callback, which must call g_resolver_lookup_by_name_finish() to get the result. See g_resolver_lookup_by_name() for more details.

Available since: 2.22

Gio.ResolverClass.lookup_by_name_finish

Retrieves the result of a call to g_resolver_lookup_by_name_async().

Available since: 2.22

Gio.ResolverClass.lookup_by_name_with_flags

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

Gio.ResolverClass.lookup_by_name_with_flags_async

Begins asynchronously resolving hostname to determine its associated IP address(es), and eventually calls callback, which must call g_resolver_lookup_by_name_with_flags_finish() to get the result. See g_resolver_lookup_by_name() for more details.

Available since: 2.60

Gio.ResolverClass.lookup_by_name_with_flags_finish

Retrieves the result of a call to g_resolver_lookup_by_name_with_flags_async().

Available since: 2.60

Gio.ResolverClass.lookup_records

Synchronously performs a DNS record lookup for the given rrname and returns a list of records as GVariant tuples. See GResolverRecordType for information on what the records contain for each record_type.

Available since: 2.34

Gio.ResolverClass.lookup_records_async

Begins asynchronously performing a DNS lookup for the given rrname, and eventually calls callback, which must call g_resolver_lookup_records_finish() to get the final result. See g_resolver_lookup_records() for more details.

Available since: 2.34

Gio.ResolverClass.lookup_records_finish

Retrieves the result of a previous call to g_resolver_lookup_records_async(). Returns a non-empty list of records as GVariant tuples. See GResolverRecordType for information on what the records contain.

Available since: 2.34

Gio.ResolverClass.lookup_service
No description available.
Gio.ResolverClass.lookup_service_async
No description available.
Gio.ResolverClass.lookup_service_finish

Retrieves the result of a previous call to g_resolver_lookup_service_async().

Available since: 2.22

Gio.ResolverClass.reload
No description available.