romuloceccon / lightmqtt

MQTT 3.1.1 client library written in pure C, fully asynchronous, supporting QoS 0, 1 and 2 messages and large payloads
MIT License
14 stars 6 forks source link

Automatic connect function #2

Open skyformat99 opened 7 years ago

skyformat99 commented 7 years ago

Can you add automatic connect function? thanks. For instance, When the broker restarts, ping/pong test cannot auto connect to the broker server.

like as: typedef void (lmqtt_client_on_disconnect_t)(void , lmqtt_connect_t *, int);

skyformat99 commented 7 years ago

hi, Recently, I learned about paho. MQTT. C, and found the function as: void connectionLost(void context, char cause) url: https://github.com/eclipse/paho.mqtt.c/blob/master/src/samples/paho_c_pub.c

so, Maybe the following function names are more appropriate: typedef void (lmqtt_client_on_connect_lost)(void , lmqtt_connect_t *, int);

disconnect: Disconnect actively by itself connect_lost: Passive disconnect.