ConnectionMigrationOptions

class ConnectionMigrationOptions


用于配置 Cronet 的连接迁移功能的类。

当客户端设备切换其 L4 连接(通常是因使用不同网络而产生的 IP 地址)时,连接迁移功能可防止与服务器的打开连接被销毁。这种情况在移动设备失去 Wi-Fi 连接并切换到移动数据时尤为常见,反之亦然(又称“停车场问题”)。QUIC 使用独立于底层传输层的连接标识符来实现此功能。如果客户端连接到新网络并希望保留现有连接,则可以使用服务器已知为现有连接的延续的连接标识符来实现此目的。

这些功能仅适用于 QUIC 连接,并且服务器需要支持连接迁移。

摘要

嵌套类型

ConnectionMigrationOptions 的构建器。

用于尚未被视为稳定的 API 的注解。

公共函数

builder

java-static fun builder(): ConnectionMigrationOptions.Builder!

getAllowNonDefaultNetworkUsage

fun getAllowNonDefaultNetworkUsage(): Boolean?

getAllowServerMigration

fun getAllowServerMigration(): Boolean?

getEnableDefaultNetworkMigration

fun getEnableDefaultNetworkMigration(): Boolean?

getEnablePathDegradationMigration

fun getEnablePathDegradationMigration(): Boolean?

getIdleMigrationPeriodSeconds

fun getIdleMigrationPeriodSeconds(): Long?

getMaxPathDegradingEagerMigrationsCount

fun getMaxPathDegradingEagerMigrationsCount(): Int?

getMaxTimeOnNonDefaultNetworkSeconds

fun getMaxTimeOnNonDefaultNetworkSeconds(): Long?

getMaxWriteErrorEagerMigrationsCount

fun getMaxWriteErrorEagerMigrationsCount(): Int?

getMigrateIdleConnections

fun getMigrateIdleConnections(): Boolean?

getRetryPreHandshakeErrorsOnAlternateNetwork

fun getRetryPreHandshakeErrorsOnAlternateNetwork(): Boolean?