-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic connect function #41
Comments
Hi skyformat99, Thanks for the excellent suggestion! The "Add automatic re-connect" is already on our feature request list, but I will give it a bump up on the list. I expect this feature to be added by the end of this 2017. How urgent is the automatic reconnect requirement for using wolfMQTT? Thanks, |
@dgarske This feature should be a very useful feature. For example, in 4G network communication, there are often network failures, and if there are automatic reconnect functions (including automatic pub and sub), it will be much more convenient. |
Have any progress about it? |
I'm in need of the same feature, I tried to see if I could loop the |
This feature is being added and should be available next week. I will post an update here when its ready. Thanks, David Garske |
Hi All, I've pushed a basic disconnect callback to a pull request here: The callbacks are issued from the I would like to see an automatic reconnect feature as the next step for this. Let me know your thoughts. Thanks, |
Hi @dgarske I'm trying to do the following
How would I use this callback you added currently? Within the netwrite thread my program stalls at the 'connect' or 'write' function. This is the function - and this is the line I will also try to see if I get a better result when I try closing the broker once a connection has been established to the client. |
any update on the automatic reconnect? is there a way to implement it ourselves? |
Hi All, The actual socket handling for connect is handled via callbacks, which the consumer of the library is responsible for setting up. If you are waiting for a message If you get a response code that is not We added a disconnect callback that you can register via Let me know if you have any questions or issues. Thanks, |
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:
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.
The text was updated successfully, but these errors were encountered: