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

IIotHubServiceRetryPolicy.ShouldRetry(UInt32, Exception, TimeSpan) 方法

定义

重试前由客户端调用的方法。

public bool ShouldRetry(uint currentRetryCount, Exception lastException, out TimeSpan retryDelay);
abstract member ShouldRetry : uint32 * Exception * TimeSpan -> bool
Public Function ShouldRetry (currentRetryCount As UInteger, lastException As Exception, ByRef retryDelay As TimeSpan) As Boolean

参数

currentRetryCount
UInt32

尝试当前操作的次数。

lastException
Exception

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

retryDelay
TimeSpan

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

返回

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

适用于