Language

DnsOptions.StaleDnsOptions.Builder.SetUseStaleOnNameNotResolved Method

Definition

Sets whether to allow use of stale DNS results when network resolver fails to resolve the hostname.

[Android.Runtime.Register("setUseStaleOnNameNotResolved", "(I)Landroid/net/http/DnsOptions$StaleDnsOptions$Builder;", "", ApiSince=34)]
public Android.Net.Http.DnsOptions.StaleDnsOptions.Builder SetUseStaleOnNameNotResolved(Android.Net.Http.DnsOption state);
[<Android.Runtime.Register("setUseStaleOnNameNotResolved", "(I)Landroid/net/http/DnsOptions$StaleDnsOptions$Builder;", "", ApiSince=34)>]
member this.SetUseStaleOnNameNotResolved : Android.Net.Http.DnsOption -> Android.Net.Http.DnsOptions.StaleDnsOptions.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 to allow use of stale DNS results when network resolver fails to resolve the hostname.

Depending on the use case, if the DNS resolver quickly sees a fresh failure, it may be desirable to use the failure as it is technically the fresher result, and we had such a fresh result quickly; or, prefer having any result (even if stale) to use over dealing with a DNS failure.

Android reference for android.net.http.DnsOptions.StaleDnsOptions.Builder.setUseStaleOnNameNotResolved.

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