Skip to content

Commit f94efb1

Browse files
authored
Help with TLS timeout problems (aws#172)
- update submodules, gets aws-c-io with longer default TLS timeouts. - Expose MqttConnection::SetReconnectTimeout(...)
1 parent a910dca commit f94efb1

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

include/aws/crt/mqtt/MqttClient.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ namespace Aws
139139
*/
140140
bool SetWebsocketProxyOptions(const Http::HttpClientConnectionProxyOptions &proxyOptions) noexcept;
141141

142+
/**
143+
* Customize time to wait between reconnect attempts.
144+
* The time will start at min and multiply by 2 until max is reached.
145+
* The time resets back to min after a successful connection.
146+
* This function should only be called before Connect().
147+
*/
148+
bool SetReconnectTimeout(uint64_t min_seconds, uint64_t max_seconds) noexcept;
149+
142150
/**
143151
* Initiates the connection, OnConnectionCompleted will
144152
* be invoked in an event-loop thread.

source/mqtt/MqttClient.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ namespace Aws
330330
return true;
331331
}
332332

333+
bool MqttConnection::SetReconnectTimeout(uint64_t min_seconds, uint64_t max_seconds) noexcept
334+
{
335+
return aws_mqtt_client_connection_set_reconnect_timeout(
336+
m_underlyingConnection, min_seconds, max_seconds) == 0;
337+
}
338+
333339
bool MqttConnection::Connect(
334340
const char *clientId,
335341
bool cleanSession,

0 commit comments

Comments
 (0)