1auto_reconnect(3) Library Functions Manual auto_reconnect(3)
2
3
4
6 auto_reconnect - Automatic Reconnect The ability for the client library
7 to reconnect automatically in the event of a connection failure was
8 added in 1.1. The connection lost callback allows a flexible response
9 to the loss of a connection, so almost any behaviour can be implemented
10 in that way. Automatic reconnect does have the advantage of being a
11 little simpler to use.
12
13 To switch on automatic reconnect, the connect options field
14 automaticReconnect should be set to non-zero. The minimum and maximum
15 times before the next connection attempt can also be set, the defaults
16 being 1 and 60 seconds. At each failure to reconnect, the retry
17 interval is doubled until the maximum value is reached, and there it
18 stays until the connection is successfully re-established whereupon it
19 is reset.
20
21 When a reconnection attempt is successful, the MQTTAsync_connected
22 callback function is invoked, if set by calling MQTTAsync_setConnected.
23 This allows the application to take any actions needed, such as
24 amending subscriptions.
25
26
27
28Paho Asynchronous MQTT C Client LFirbiraJruyl 22 2022 auto_reconnect(3)