I am trying to implement network reconnection logic to avoid network disconnection in runtime,
- IotMqtt_Connect() is called with disconnect callback set, so whenever the MQTT is disconnected this callback should be invoked,
- Whenever there is no network, call back is called with reason IOT_MQTT_KEEP_ALIVE_TIMEOUT,
- In a separate task, i am Waiting for connection retry delay, and calling IotMqtt_Connect() again.
When ping request is not received _IotMqtt_CloseNetworkConnection() is called which inturn calls SOCKETS_Shutdown() ultimately, not SOCKETS_Close()
so if I call IotMqtt_Connect() , it creates a new socket instead of using the existing one, my wifi(TI CC3135) supports max of 16 sockets, after retrying for 16 times, I am getting error “no free sockets available”