Hi Ian,
I am using Paho Mqtt C Client on my device to send event
some notifications.I am facing issues with the
automatic
reconnect functionality.It is not working sometimes[
2
out 10 times] when i plug out the ethernet cable from
my device.
I have attached two log files here for the successful and
failure cases for your reference.For the successfull case ,u
can see the below prints which confirms that it is retrying to
connect.
Debug: Connect failed, rc 0 (connect failure callback
prnts)
But for the Failure case these prints are not coming which
means it is not retying and connect failed callback is not
getting called.
Code Details:
conn_opts.keepAliveInterval = 5;
conn_opts.cleansession = 1;
conn_opts.automaticReconnect = 1;
conn_opts.connectTimeout = 3;
conn_opts.minRetryInterval = 4;
conn_opts._onSuccess_ = onConnect;
conn_opts._onFailure_ = onConnectFailure;
void onConnectFailure(void* context,
MQTTAsync_failureData* response)
{
DEBUG("Connect failed, rc %d\n", response ?
response->code : 0);
}
#define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T',
'C'}, 4, 60, 1, 10, NULL, NULL, NULL, 30, 0, NULL, NULL, NULL,
NULL, 0, NULL, 0, 0, 1, 60}
Kindly help me with this issue.Let me know if we need to modify
the conn_opts values.