Hi Roger,
Yes my code does not call mosquitto_lib_cleanup().
I have attached the sample code for your reference.
This sample code is integrated into a host where other applications also run which uses TLS connection.
Step 1:
Below method is called only once after the host system is up
mosquitto_lib_init();
Step 2:
Below methods are called before publishing data to broker
mosquitto_new
mosquitto_connect_callback_set
mosquitto_disconnect_callback_set
mosquitto_publish_callback_set
mosquitto_username_pw_set
mosquitto_tls_opts_set
mosquitto_tls_set
mosquitto_tls_insecure_set
mosquitto_connect
Step 3:
To publish data, below methods are called
mosquitto_loop_start
mosquitto_publish
Step 4:
Whenever configuration is getting changed/any connection errors/broker not reachable etc, below method is called
mosquitto_destroy
So below is the sequence
Step 1 - Only once
Step 2 - Initially called later after Step 4
Step 3 - This step will be active always. Because system is streaming the data to broker
Step 4 - Called during error cases. Then goes to Step 2
In my system Step 4 is happening very frequently, due to that Step 2-> Step 3->Step 4 sequence is happening more often.
During the execution of above sequence other applications are not able to send data over HTTPS to external servers due to SSL Context and later system moves into unknown behavior.
regards,
Sriram I