【问题标题】:How to set the number of auto-reconnect attempts of AWSIoTManager如何设置 AWSIoTManager 的自动重连尝试次数
【发布时间】:2019-10-04 13:33:30
【问题描述】:

如何设置 AWSIoTManager 的自动重连尝试次数和重试限制?

这是 java 示例:

aWSIotMqttManager = AWSIotMqttManager(..)
aWSIotMqttManager.maxAutoReconnectAttempts = 1
aWSIotMqttManager.setReconnectRetryLimits(1, 4)

【问题讨论】:

    标签: ios amazon-web-services aws-sdk aws-iot


    【解决方案1】:

    aws-sdk-ios上,您可以为每个服务提供注册配置(如AWSIoTManager所示)

    AWSServiceConfigurationinherits fromAWSNetworkingConfiguration,其中有maxRetryCount属性:

    失败请求的最大重试次数。该值需要介于 0 和 10(含)之间。如果设置为高于 10,则变为 10。

    例如(快速):

    let configuration = AWSServiceConfiguration(maxRetryCount: 7)
    AWSIoTManager.register(with: configuration!, forKey: "USWest2IoTManager")
    

    【讨论】:

    • maxRetryCount 是否应该限制发生连接错误后自动重新连接的尝试次数?
    猜你喜欢
    • 1970-01-01
    • 2018-04-08
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 2014-06-03
    • 2016-01-13
    • 1970-01-01
    相关资源
    最近更新 更多