Language

DnsOptions.Builder.SetPreestablishConnectionsToStaleDnsResults Method

Definition

Sets whether Cronet should use stale cached DNS records to pre-establish connections.

[Android.Runtime.Register("setPreestablishConnectionsToStaleDnsResults", "(I)Landroid/net/http/DnsOptions$Builder;", "", ApiSince=34)]
public Android.Net.Http.DnsOptions.Builder SetPreestablishConnectionsToStaleDnsResults(Android.Net.Http.DnsOption state);
[<Android.Runtime.Register("setPreestablishConnectionsToStaleDnsResults", "(I)Landroid/net/http/DnsOptions$Builder;", "", ApiSince=34)>]
member this.SetPreestablishConnectionsToStaleDnsResults : Android.Net.Http.DnsOption -> Android.Net.Http.DnsOptions.Builder

Parameters

state
DnsOption

one of the DNS_OPTION_* values. Value is one of the following: DnsOptions.DNS_OPTION_UNSPECIFIED; DnsOptions.DNS_OPTION_ENABLED; DnsOptions.DNS_OPTION_DISABLED

Returns

the builder for chaining. This value cannot be null.

Attributes

Remarks

Sets whether Cronet should use stale cached DNS records to pre-establish connections.

If enabled, Cronet will optimistically pre-establish connections to servers that matched the hostname at some point in the past and were cached but the cache entry expired. Such connections won't be used further until a new DNS lookup confirms the cached record was up to date.

To use cached DNS records straight away, use setStaleDns(int) and StaleDnsOptions configuration options.

This option may not be available for all networking protocols.

Android reference for android.net.http.DnsOptions.Builder.setPreestablishConnectionsToStaleDnsResults.

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