paho.mqtt.javascript icon indicating copy to clipboard operation
paho.mqtt.javascript copied to clipboard

[Feature Request] Set custom reconnect interval and/or set max reconnect interval

Open corey-mitchell opened this issue 6 years ago • 0 comments

When locking the screen from a mobile device, the client's connection is severed. If the screen is immediately opened then the client is reconnected and everything is fine. However, if the screen is left locked for a few minutes then the client takes up to two minutes to reconnect.

According to the docs, this is because the reconnect interval doubles every failure, maxing out at two minutes.

This is an understandable feature and a great default, however, it would be very nice to be able to set a consistent interval. Or perhaps be able to set the max reconnect interval along with the initial reconnect interval. Similar to the reconnect_delay_set() method for the python version.

I see from #48 that this feature was part of the plan for the automatic reconnect and disconnect. It seems that 'reconnectInterval' was supposed to be an option for the connection options object. However, it does not work today so I'm not sure if it was never added in or if it was later taken out but this would be a very worthwhile feature to have.

corey-mitchell avatar Sep 24 '19 20:09 corey-mitchell