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 followed by mosquitto_connect_async fails to reconnect (again) #2868

Open
ViniG-8 opened this issue Aug 10, 2023 · 1 comment

Comments

@ViniG-8
Copy link

ViniG-8 commented Aug 10, 2023

I'm using Mosquitto 2.0.15 (on Linux Busybox 1.34.1-1 embedded system).

For the connection, I call :

mosquitto_new
mosquitto_int_option --> MOSQ_OPT_PROTOCOL_VERSION --> MQTT_PROTOCOL_V311
mosquitto_threaded_set  --> true
mosquitto_connect_callback_set, mosquitto_disconnect_callback_set, mosquitto_message_callback_set
mosquitto_connect_bind_async
mosquitto_socket

--> I use my own thread and manage my own select(), and I call mosquitto_loop_misc each second.

Connection is OK and mosquitto_publish is working fine.

Then, when I disconnect with mosquitto_disconnect, and if I try to reconnect with mosquitto_reconnect_async or mosquitto_connect_bind_async, the TCP connection is done, but mosquitto does not send any 'CONNECT' message, so mosquitto is stucked, and the connection fails.

This is similar to the issue #2242. Just in case, I already tried to use the mosquitto_threaded_set workaround, but it's not working better.

Any help/ideas ?

Thanks !

@anthonio9
Copy link

Is this resolved for you in 2.0.18? I'm having a similar problem #2974.

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

2 participants