ConnectionMigrationOptions

class ConnectionMigrationOptions


設定 Cronet 連線遷移功能的類別。

當用戶端裝置切換 L4 連線 (通常是使用不同網路而產生的 IP 位址) 時,連線遷移功能會停止毀損與伺服器的開放連線。如果行動裝置失去 Wi-Fi 連線並切換至行動數據,或反之 (又稱停車場問題),就特別容易發生這種情況。QUIC 使用獨立於基礎傳輸層的連線 ID,因此可以達成這項功能。如果用戶端連上新網路,但想保留現有連線,可以使用伺服器已知的連線 ID,將新連線視為現有連線的延續。

這些功能僅適用於 QUIC 連線,且伺服器必須支援連線遷移。

摘要

巢狀型別

ConnectionMigrationOptions 的建構工具。

API 的註解,表示 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?