如何设置AWSIoTManager的自动重新连接尝试次数和重试限制?
这是java示例:
aWSIotMqttManager = AWSIotMqttManager(..)
aWSIotMqttManager.maxAutoReconnectAttempts = 1
aWSIotMqttManager.setReconnectRetryLimits(1, 4)
答案 0 :(得分:1)
在aws-sdk-ios
上,您可以为每个服务提供注册配置(如AWSIoTManager所示)
AWSServiceConfiguration
inherits from AWSNetworkingConfiguration
,其中具有属性maxRetryCount
:
失败请求的最大重试次数。该值必须介于0和10之间(含0和10)。如果设置为大于10,则变为10。
例如(快速):
let configuration = AWSServiceConfiguration(maxRetryCount: 7)
AWSIoTManager.register(with: configuration!, forKey: "USWest2IoTManager")