-
Notifications
You must be signed in to change notification settings - Fork 41
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
Disconnections Management #100
Comments
Hello You're right, this is on my todo list. I've never been disconnected so I did not implement this. Not planned but I keep this issue for when I have time. |
Hello, I also want to detect disconnected clients, I tried to add myself but I couldn't manage it. Is there any update about it? |
Hello, even though there is no a disconnection management implemented, i have managed to do it. I don´t know if this helps you but, i detected a client disconnection using "Clients_connected = broker.clientsCount();" With this command i can controll the number of clients i have connected to my broker, if i compare this number taken in two diferent moments of my "loop()", i can check if there was a disconnection in my broker and eventually do something with a conditional function. Controlling which client disconnected is a little bit more difficult because the library does not support "last will message", but as i only have 6 devices, y created a 6 position vector that reloads every few seconds detecting the id of the clients that are connected in that moment to the broker, in that way i can detect which client get disconnected. I´m still working on this, hope it helps! |
That would help thank you so much. |
I'm trying to implement a broker with this library and i wanted to know if there is a easy way to detect disconnected clients, i didn't found "onDisconnect()" event or anything like that, i want to know how can i detect a disconnected client and get its "id".
The text was updated successfully, but these errors were encountered: