你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IRetryPolicy.ShouldRetry(Int32, Exception, TimeSpan) 方法

定义

重试前由 DeviceClient 调用的方法。

public bool ShouldRetry(int currentRetryCount, Exception lastException, out TimeSpan retryInterval);
abstract member ShouldRetry : int * Exception * TimeSpan -> bool
Public Function ShouldRetry (currentRetryCount As Integer, lastException As Exception, ByRef retryInterval As TimeSpan) As Boolean

参数

currentRetryCount
Int32

尝试当前操作的次数。

lastException
Exception

导致此重试策略的异常检查。

retryInterval
TimeSpan

将此值设置为下次尝试之前所需的延迟。

返回

如果应重试该操作,则为 True。 否则为 False。

适用于