ReconnectionOptionTClientUseExponentialBackoff 方法
使用指数退避重连策略 - 每次失败后延迟时间指数增长
命名空间: TouchSocket.Sockets程序集: TouchSocket (在 TouchSocket.dll 中) 版本:4.1.4.7+7f7e1f78093c99347956e09330d5d7aca1d2bdf2
public void UseExponentialBackoff(
TimeSpan? baseInterval = null,
TimeSpan? maxInterval = null,
double multiplier = 2,
int maxRetryCount = -1
)
Public Sub UseExponentialBackoff (
Optional baseInterval As TimeSpan? = Nothing,
Optional maxInterval As TimeSpan? = Nothing,
Optional multiplier As Double = 2,
Optional maxRetryCount As Integer = -1
)
member UseExponentialBackoff :
?baseInterval : Nullable<TimeSpan> *
?maxInterval : Nullable<TimeSpan> *
?multiplier : float *
?maxRetryCount : int
(* Defaults:
let _baseInterval = defaultArg baseInterval null
let _maxInterval = defaultArg maxInterval null
let _multiplier = defaultArg multiplier 2
let _maxRetryCount = defaultArg maxRetryCount -1
*)
-> unit
参数
- baseInterval NullableTimeSpan (Optional)
- 基础间隔,默认1秒
- maxInterval NullableTimeSpan (Optional)
- 最大间隔,默认5分钟
- multiplier Double (Optional)
- 退避倍数,默认2.0
- maxRetryCount Int32 (Optional)
- 最大重连次数,-1表示无限重连