Skip to content
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

mosquitto_disconnect stops the network loop but mosquitto_connect doesn't start it. #2575

Open
andrewwade opened this issue Jun 22, 2022 · 0 comments

Comments

@andrewwade
Copy link

This is more of an unexpected behavior on my part and maybe I just haven't found the right documentation.

I assumed I could call the following sequence and the client would just resume running the loop after the second connect.

mosquitto_loop_start(mosq);
mosquitto_connect_async(mosq);
sleep(10);
mosquitto_disconnect(mosq);
sleep(10);
mosquitto_connect_async(mosq);
sleep(10);
mosquitto_loop_stop(mosq);

But instead, I have to call mosquitto_loop_start again after mosquitto_disconnect. Otherwise I won't get the connect callback on the second mosquitto_connect_async.

I believe it's because of the following lines:
https://github.com/eclipse/mosquitto/blob/master/lib/loop.c#L297-L298
https://github.com/eclipse/mosquitto/blob/master/lib/loop.c#L320-L321

Mosquitto Version: 2.0.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant