DnsOptions.StaleDnsOptions
public
static
class
DnsOptions.StaleDnsOptions
extends Object
java.lang.Object | |
↳ | android.net.http.DnsOptions.StaleDnsOptions |
A class configuring the stale DNS functionality.
DNS resolution is one of the steps on the critical path to making a URL request, but it can be slow for various reasons (underlying network latency, buffer bloat, packet loss, etc.). Depending on the use case, it might be worthwhile for an app developer to trade off guaranteed DNS record freshness for better availability of DNS records.
Stale results can include both:
- results returned from the current network's DNS server, but past their time-to-live, and
- results returned from a different network's DNS server, whether expired or not.
For detailed explanation of the configuration options see javadoc on
StaleDnsOptions.Builder
methods.
Summary
Nested classes | |
---|---|
class |
DnsOptions.StaleDnsOptions.Builder
Builder for |
Public methods | |
---|---|
int
|
getAllowCrossNetworkUsage()
|
Duration
|
getFreshLookupTimeout()
|
Duration
|
getMaxExpiredDelay()
|
int
|
getUseStaleOnNameNotResolved()
|
Inherited methods | |
---|---|
Public methods
getAllowCrossNetworkUsage
public int getAllowCrossNetworkUsage ()
Returns | |
---|---|
int |
Value is DnsOptions.DNS_OPTION_UNSPECIFIED , DnsOptions.DNS_OPTION_ENABLED , or DnsOptions.DNS_OPTION_DISABLED |
getFreshLookupTimeout
public Duration getFreshLookupTimeout ()
Returns | |
---|---|
Duration |
This value may be null . |
getUseStaleOnNameNotResolved
public int getUseStaleOnNameNotResolved ()
Returns | |
---|---|
int |
Value is DnsOptions.DNS_OPTION_UNSPECIFIED , DnsOptions.DNS_OPTION_ENABLED , or DnsOptions.DNS_OPTION_DISABLED |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-04 UTC.