Resolver

open class Resolver(pointer: <Error class: unknown class><<Error class: unknown class>>)

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

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gioResolverPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun connectReload(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

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

Link copied to clipboard
open fun lookupByAddress(address: InetAddress, cancellable: Cancellable? = null): <Error class: unknown class><String>

Synchronously reverse-resolves @address to determine its associated hostname.

Link copied to clipboard
open fun lookupByAddressAsync(address: InetAddress, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

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.

Link copied to clipboard
open fun lookupByAddressFinish(result: AsyncResult): <Error class: unknown class><String>

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

Link copied to clipboard
open fun lookupByName(hostname: String, cancellable: Cancellable? = null): <Error class: unknown class><<Error class: unknown class>>

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()).

Link copied to clipboard
open fun lookupByNameAsync(hostname: String, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

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.

Link copied to clipboard
open fun lookupByNameFinish(result: AsyncResult): <Error class: unknown class><<Error class: unknown class>>

Retrieves the result of a call to g_resolver_lookup_by_name_async().

Link copied to clipboard
open fun lookupByNameWithFlags(hostname: String, flags: ResolverNameLookupFlags, cancellable: Cancellable? = null): <Error class: unknown class><<Error class: unknown class>>

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.

Link copied to clipboard
open fun lookupByNameWithFlagsAsync(hostname: String, flags: ResolverNameLookupFlags, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

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.

Link copied to clipboard
open fun lookupByNameWithFlagsFinish(result: AsyncResult): <Error class: unknown class><<Error class: unknown class>>

Retrieves the result of a call to g_resolver_lookup_by_name_with_flags_async().

Link copied to clipboard
open fun lookupRecords(rrname: String, recordType: ResolverRecordType, cancellable: Cancellable? = null): <Error class: unknown class><<Error class: unknown class>>

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.

Link copied to clipboard
open fun lookupRecordsAsync(rrname: String, recordType: ResolverRecordType, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Begins asynchronously performing a DNS lookup for the given

Link copied to clipboard
open fun lookupRecordsFinish(result: AsyncResult): <Error class: unknown class><<Error class: unknown class>>

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.

Link copied to clipboard
open fun lookupService(service: String, protocol: String, domain: String, cancellable: Cancellable? = null): <Error class: unknown class><<Error class: unknown class>>

Synchronously performs a DNS SRV lookup for the given @service and

Link copied to clipboard
open fun lookupServiceAsync(service: String, protocol: String, domain: String, cancellable: Cancellable? = null, callback: AsyncReadyCallback)

Begins asynchronously performing a DNS SRV lookup for the given

Link copied to clipboard
open fun lookupServiceFinish(result: AsyncResult): <Error class: unknown class><<Error class: unknown class>>

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

Link copied to clipboard
open fun setDefault()

Sets @resolver to be the application's default resolver (reffing