-
Notifications
You must be signed in to change notification settings - Fork 51
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
reconnect() no longer disconnects already connected socket #243
Comments
The fix should be accompanied by reconnect test, including the resubscribe capability. |
@vladak do you know a server setup that will cause this to happen? Happy to fix this, but would like real world repro steps if possible |
This happened with a custom from-scratch written implementation of a MQTT broker which actually followed the spec, haven't checked any mainline implementations yet. I have a fix in the works, the tests are a bit tricky. |
Also, one interesting tidbit: when With the change proposed in PR #244 this will no longer be a problem in terms of wasted socket, however the original session ID should be used for the reconnect. |
@vladak this should be tested on an ESP32SPI. When I added session support to ConnectionManager, the ESP32SPI would have issues if it was already connected to a host |
In the past
reconnect()
disconnected on TCP level first and then created new connection to the broker. This is no longer the case and some MQTT broker implementations will (correctly, see below) refuse such reconnect attempts due to duplicate client ID. Previously it worked because_get_connect_socket()
used byconnect()
didself._sock.close()
so I assume this changed with the conversion to the connection manager.The spec says in 3.1.4 Response:
The text was updated successfully, but these errors were encountered: