Språk

DnsResolver.Query Method

Definition

Overloads

Name Description
Query(Network, String, DnsResolverFlag, IExecutor, CancellationSignal, DnsResolver+ICallback)

Send a DNS query with the specified name on a network with both IPv4 and IPv6, get back a set of InetAddresses with rfc6724 sorting asynchronously.

Query(Network, String, DnsResolverFlag, IExecutor, Int32, CancellationSignal, DnsResolver+ICallback)

Send concurrent A/AAAA/HTTPS DNS queries with the specified name on a network.

Query(Network, String, DnsResolverType, DnsResolverFlag, IExecutor, CancellationSignal, DnsResolver+ICallback)

Send a DNS query with the specified name and query type, get back a set of InetAddresses with rfc6724 sorting asynchronously.

Query(Network, String, DnsResolverFlag, IExecutor, CancellationSignal, DnsResolver+ICallback)

Send a DNS query with the specified name on a network with both IPv4 and IPv6, get back a set of InetAddresses with rfc6724 sorting asynchronously.

[Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;ILjava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=29)]
public void Query(Android.Net.Network? network, string domain, Android.Net.DnsResolverFlag flags, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal? cancellationSignal, Android.Net.DnsResolver.ICallback callback);
[<Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;ILjava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=29)>]
member this.Query : Android.Net.Network * string * Android.Net.DnsResolverFlag * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.Net.DnsResolver.ICallback -> unit

Parameters

network
Network

Network specifying which network to query on. null for query on default network.

domain
String

domain name to query. This value cannot be null.

flags
DnsResolverFlag

flags as a combination of the FLAGS_* constants. Value is one of the following: FLAG_EMPTY; FLAG_NO_RETRY; FLAG_NO_CACHE_STORE; FLAG_NO_CACHE_LOOKUP

executor
IExecutor

The Executor that the callback should be executed on. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

cancellationSignal
CancellationSignal

used by the caller to signal if the query should be cancelled. May be null.

callback
DnsResolver.ICallback

a Callback which will be called to notify the caller of the result of dns query. This value cannot be null.

Attributes

Remarks

Java documentation for android.net.DnsResolver.query(android.net.Network, java.lang.String, int, java.util.concurrent.Executor, android.os.CancellationSignal, android.net.DnsResolver.Callback).

Android reference for android.net.DnsResolver.query.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Query(Network, String, DnsResolverFlag, IExecutor, Int32, CancellationSignal, DnsResolver+ICallback)

Send concurrent A/AAAA/HTTPS DNS queries with the specified name on a network.

[Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;ILjava/util/concurrent/Executor;ILandroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=37)]
public void Query(Android.Net.Network? network, string domain, Android.Net.DnsResolverFlag flags, Java.Util.Concurrent.IExecutor executor, int httpsTimeoutMillis, Android.OS.CancellationSignal? cancellationSignal, Android.Net.DnsResolver.ICallback callback);
[<Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;ILjava/util/concurrent/Executor;ILandroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=37)>]
member this.Query : Android.Net.Network * string * Android.Net.DnsResolverFlag * Java.Util.Concurrent.IExecutor * int * Android.OS.CancellationSignal * Android.Net.DnsResolver.ICallback -> unit

Parameters

network
Network

Network specifying which network to query on. null for query on default network.

domain
String

domain name to query. This value cannot be null.

flags
DnsResolverFlag

flags as a combination of the FLAGS_* constants. Value is one of the following: FLAG_EMPTY; FLAG_NO_RETRY; FLAG_NO_CACHE_STORE; FLAG_NO_CACHE_LOOKUP

executor
IExecutor

The Executor that the callback should be executed on. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

httpsTimeoutMillis
Int32

the timeout in milliseconds to wait for the HTTPS query to complete after the A/AAAA queries have already completed. May be set to HTTPS_QUERY_WAIT_NONE to disable any additional wait, HTTPS_QUERY_WAIT_AUTO to use the default wait time, HTTPS_QUERY_WAIT_UNTIL_TIMEOUT to wait for the HTTPS query to complete, or a specific value in milliseconds.

cancellationSignal
CancellationSignal

used by the caller to signal if all the queries should be cancelled. May be null.

callback
DnsResolver.ICallback

a Callback which will be called to notify the caller of the results of the A/AAAA/HTTPS DNS queries. Will return a ERROR_PARSE if any of the DNS records cannot be parsed, and should be treated as a resolution failure. This value cannot be null.

Attributes

Remarks

Send concurrent A/AAAA/HTTPS DNS queries with the specified name on a network. The answer to all queries will be provided asynchronously through the provided callback Callback, which provides a HttpsEndpoint.

Android reference for android.net.DnsResolver.query.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Query(Network, String, DnsResolverType, DnsResolverFlag, IExecutor, CancellationSignal, DnsResolver+ICallback)

Send a DNS query with the specified name and query type, get back a set of InetAddresses with rfc6724 sorting asynchronously.

[Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;IILjava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=29)]
public void Query(Android.Net.Network? network, string domain, Android.Net.DnsResolverType nsType, Android.Net.DnsResolverFlag flags, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal? cancellationSignal, Android.Net.DnsResolver.ICallback callback);
[<Android.Runtime.Register("query", "(Landroid/net/Network;Ljava/lang/String;IILjava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/net/DnsResolver$Callback;)V", "", ApiSince=29)>]
member this.Query : Android.Net.Network * string * Android.Net.DnsResolverType * Android.Net.DnsResolverFlag * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.Net.DnsResolver.ICallback -> unit

Parameters

network
Network

Network specifying which network to query on. null for query on default network.

domain
String

domain name to query. This value cannot be null.

nsType
DnsResolverType

dns resource record (RR) type as one of the TYPE_* constants. Value is one of the following: TYPE_A; TYPE_AAAA; TYPE_HTTPS

flags
DnsResolverFlag

flags as a combination of the FLAGS_* constants. Value is one of the following: FLAG_EMPTY; FLAG_NO_RETRY; FLAG_NO_CACHE_STORE; FLAG_NO_CACHE_LOOKUP

executor
IExecutor

The Executor that the callback should be executed on. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

cancellationSignal
CancellationSignal

used by the caller to signal if the query should be cancelled. May be null.

callback
DnsResolver.ICallback

a Callback which will be called to notify the caller of the result of dns query. This value cannot be null.

Attributes

Remarks

Java documentation for android.net.DnsResolver.query(android.net.Network, java.lang.String, int, int, java.util.concurrent.Executor, android.os.CancellationSignal, android.net.DnsResolver.Callback).

Android reference for android.net.DnsResolver.query.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to