MQTT automatic reconnect function – keep alive

Hi
I'm playing with MKR1000 (arduino wifi101) board implementing an MQTT client to push some sensor data to the cloud via Mosquitto broker

I use the MQTT library for Arduino based on the Eclipse Paho projects and I don't see any API to see the connection status (send a PINGREQ to the borker a) and so implement a watchdog mechanism to keep the connection up and in case of transient erro re-connect automatically

does anyone has an idea how to implement such a function ?

thanks

Davide