Closed troygnichols closed 8 years ago
Yes, this looks good.
If the application is purposefully disconnecting, then there shouldn't be any ping exceptions.
If the network is unexpectedly interrupted, while subscribed, then there should be an exception.
Thanks!
nick.
I'm not 100% sure this is the correct solution, but it solved a problem for me so I thought I'd at least share it and see if it's useful for you.
The problem I'm trying to solve:
MQTT::ProtocolException
, "No Ping Response received...")Maybe that really is the correct behavior, I dunno, but I would expect pinging to stop once the client disconnects (I'm a noob at MQTT so not sure).
So my solution is just don't do keepalives if the client is disconnected.