| java.lang.Object | |
| ↳ | org.chromium.net.ConnectionMigrationOptions.Builder |
Builder for ConnectionMigrationOptions.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Sets whether connections can be migrated to an alternate network when Cronet detects
a degradation of the path currently in use.
| |||||||||||
Enables the possibility of migrating connections to an alternate server address
at the server's request.
| |||||||||||
Creates and returns the final
ConnectionMigrationOptions instance, based on the
values in this builder. | |||||||||||
Enables the possibility of migrating connections on default network change.
| |||||||||||
Enables the possibility of migrating connections if the current path is performing
poorly.
| |||||||||||
Configures whether migration of idle connections should be enabled or not.
| |||||||||||
Sets whether connections with pre-handshake errors should be retried on an alternative
network.
| |||||||||||
Sets the maximum idle period for which connections will still be migrated, in seconds.
| |||||||||||
Sets the maximum number of migrations to the non-default network upon encountering path
degradation for the existing connection.
| |||||||||||
Sets the maximum period for which eagerly migrated connections should remain on the
non-default network before they're migrated back.
| |||||||||||
Sets the maximum number of migrations to the non-default network upon encountering write
errors.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
Sets whether connections can be migrated to an alternate network when Cronet detects a degradation of the path currently in use.
Note: This setting can result in requests being sent on non-default metered networks.
Make sure you're using metered networks sparingly, and fine tune parameters like
setMaxPathDegradingNonDefaultNetworkMigrationsCount(int)
and setMaxTimeOnNonDefaultNetworkSeconds(long) to limit the time on non-default
networks.
| Parameters | |
|---|---|
enable |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Enables the possibility of migrating connections to an alternate server address at the server's request.
| Parameters | |
|---|---|
allowServerMigration |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Creates and returns the final ConnectionMigrationOptions instance, based on the
values in this builder.
| Returns | |
|---|---|
ConnectionMigrationOptions |
|
Enables the possibility of migrating connections on default network change. If enabled, active QUIC connections will be migrated onto the new network when the platform indicates that the default network is changing.
| Parameters | |
|---|---|
enableDefaultNetworkConnectionMigration |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
See also:
Enables the possibility of migrating connections if the current path is performing poorly.
Depending on other configuration, this can result to migrating the connections within the same default network, or to a non-default network.
| Parameters | |
|---|---|
enable |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
See also:
Configures whether migration of idle connections should be enabled or not.
If set to true, idle connections will be migrated too, as long as they haven't been
idle for too long. The setting is shared for all connection migration types. The maximum
idle period for which connections will still be migrated can be customized using setIdleConnectionMigrationPeriodSeconds(long).
| Parameters | |
|---|---|
migrateIdleConnections |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Sets whether connections with pre-handshake errors should be retried on an alternative network.
If true, a new connection may be established an alternate network if it fails on the default network before handshake is confirmed.
Note: similarly to allowNonDefaultNetworkUsage(boolean) this setting can
result in requests being sent on non-default metered networks. Use with caution!
| Parameters | |
|---|---|
retryPreHandshakeErrorsOnAlternateNetwork |
boolean |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Sets the maximum idle period for which connections will still be migrated, in seconds. The setting is shared for all connection migration types.
Only relevant if migrateIdleConnections(boolean) is enabled.
| Parameters | |
|---|---|
idleConnectionMigrationPeriodSeconds |
long |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Sets the maximum number of migrations to the non-default network upon encountering path degradation for the existing connection. Counted cumulatively per network per connection.
Only relevant if allowNonDefaultNetworkUsage(boolean) is enabled.
| Parameters | |
|---|---|
maxPathDegradingEagerMigrationsCount |
int |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Sets the maximum period for which eagerly migrated connections should remain on the non-default network before they're migrated back. This time is not cumulative - each migration off the default network for each connection measures and compares to this value separately.
Only relevant if allowNonDefaultNetworkUsage(boolean) is enabled.
| Parameters | |
|---|---|
maxTimeOnNonDefaultNetworkSeconds |
long |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |
Sets the maximum number of migrations to the non-default network upon encountering write errors. Counted cumulatively per network per connection.
Only relevant if allowNonDefaultNetworkUsage(boolean) is enabled.
| Parameters | |
|---|---|
maxWriteErrorEagerMigrationsCount |
int |
| Returns | |
|---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining |