Langue

DnsResolver.Query Method

Definition

Overloads

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

[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
domain
String
executor
IExecutor
cancellationSignal
CancellationSignal
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).

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)

[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
domain
String
executor
IExecutor
cancellationSignal
CancellationSignal
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).

Applies to