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
connect_async does not connect when done after loop_start #848
Comments
The connection wouldn't always complete if mosquitto_loop_start() was called before mosquitto_connect_async(). Closes #848. Thanks to Ian Gough. Bug: #848 Signed-off-by: Roger A. Light <[email protected]>
I've pushed a change that should fix this. Thanks for the example code, it is very much appreciated. If you want to give it a try please get the |
Tested against the |
The connection wouldn't always complete if mosquitto_loop_start() was called before mosquitto_connect_async(). Closes #848. Thanks to Ian Gough. Bug: #848 Signed-off-by: Roger A. Light <[email protected]>
Mosquitto: 1.4.15.0ubuntu
Ubuntu: 16.04
Occasionally, when connect_async is issued shortly after loop_start, an immediate connection does not occur. When connect_async is issued prior to loop_start, a connection always immediately occur. In the code below, if you run it 3 or 4 times, it should fail at least once to connect within 1 second. This appears to be timing sensitive since commenting out the
cout << getTime() << " Loop started" << endl;
causes it to work.The text was updated successfully, but these errors were encountered: