Hi,
Our application uses MQTT over TLS to talk to a MQTT broker.
The MQTT APIs used are like in the 'mqtt_simple' sample code.
When mqtt_connect is called with invalid client ID, we see that connect call is successful and we get MQTT event - MQTT_EVT_CONNACK with result code 4.
So we try to redo the mqtt_connect and if this is done multiple times, we see subsequent tcp socket open calls failing.
We suspect its because the sockets used in mqtt_connect is not getting closed, we tried invoking mqtt_disconnect to close the socket in such cases , but that didn't help. mqtt_disconnect failed with return -128.
Finally when we explicitly did a close on the mqtt socket handle , the issue seems resolved, just wanted to know if this is what we should be doing in the application.
Is there any other cleanup that the application should handle.
Thanks in advance