This change implements exponential back-off for connect/reconnect based on the Google IoT algorithm description (sic!), with a nuance in handling temporary errors (like name resolution errors or memory shortage). At one point I had code that applied the exponential back-off also for successfull reconnect()s, however found it a bit too complex and hand-holdy. If one calls reconnect() in a loop even after prior successful connect without sleeping in between, he probably deserves to be rate limited by the broker.
This change implements exponential back-off for connect/reconnect based on the Google IoT algorithm description (sic!), with a nuance in handling temporary errors (like name resolution errors or memory shortage). At one point I had code that applied the exponential back-off also for successfull reconnect()s, however found it a bit too complex and hand-holdy. If one calls reconnect() in a loop even after prior successful connect without sleeping in between, he probably deserves to be rate limited by the broker.