davidepianca98/KMQTT

KMQTT Broker: Any way to know if the broker has been started or stopped adter broker.listen() or broker.stop() gets executed? Something like a listener ??

Closed this issue · 4 comments

Would it be possible to add a Broker Started/Stopped listener?

Hello, thanks for the suggestion. I will add some way of checking if the broker is running as soon as I can.
But shouldn't you get an exception if the broker has stopped because of an error? What is your specific use case?

The use case is for the KMQTT broker itself - I want to show message like "Broker started/ Broker stopped" messages in my standalone broker app.
I can do a toast after successful broker.listen() and broker.stop(). But I think I still need to listen to port, if it gets closed abruptly by system, and update the UI for the broker accordingly.

Thanks a lot, I will add it whenever I have some time!

Added in 225f2a0