| java.lang.Object | |
| ↳ | org.chromium.net.DnsOptions.Builder |
Builder for DnsOptions.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates and returns the final
DnsOptions instance, based on the values in this
builder. | |||||||||||
Sets whether to use stale DNS results at all.
| |||||||||||
Sets whether the DNS cache should be persisted to disk.
| |||||||||||
Sets whether Cronet should use stale cached DNS records to pre-establish connections.
| |||||||||||
Same as
setPersistHostCachePeriodMillis(long) but using Duration. | |||||||||||
Sets the minimum period between subsequent writes to disk for DNS cache persistence.
| |||||||||||
Sets detailed configuration for stale DNS.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
Creates and returns the final DnsOptions instance, based on the values in this
builder.
| Returns | |
|---|---|
DnsOptions |
|
Sets whether to use stale DNS results at all.
| Parameters | |
|---|---|
enable |
boolean |
| Returns | |
|---|---|
DnsOptions.Builder |
the builder for chaining |
Sets whether the DNS cache should be persisted to disk.
Only relevant if setStoragePath(String) is
set.
| Parameters | |
|---|---|
persistHostCache |
boolean |
| Returns | |
|---|---|
DnsOptions.Builder |
the builder for chaining |
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 enableStaleDns(boolean) and DnsOptions.StaleDnsOptions configuration options.
This option may not be available for all networking protocols.
| Parameters | |
|---|---|
enable |
boolean |
| Returns | |
|---|---|
DnsOptions.Builder |
the builder for chaining |
Same as setPersistHostCachePeriodMillis(long) but using Duration.
| Parameters | |
|---|---|
persistToDiskPeriod |
Duration |
| Returns | |
|---|---|
DnsOptions.Builder |
the builder for chaining |
Sets the minimum period between subsequent writes to disk for DNS cache persistence.
Only relevant if persistHostCache(boolean) is set to true.
| Parameters | |
|---|---|
persistHostCachePeriodMillis |
long |
| Returns | |
|---|---|
DnsOptions.Builder |
the builder for chaining |
| Parameters | |
|---|---|
staleDnsOptionsBuilder |
DnsOptions.StaleDnsOptions.Builder |
| Returns | |
|---|---|
DnsOptions.Builder |
|
See also:
Sets detailed configuration for stale DNS.
Only relevant if enableStaleDns(boolean) is set.
| Parameters | |
|---|---|
staleDnsOptions |
DnsOptions.StaleDnsOptions |
| Returns | |
|---|---|
DnsOptions.Builder |
this builder for chaining. |
| Parameters | |
|---|---|
enable |
boolean |
| Returns | |
|---|---|
DnsOptions.Builder |
|