blynkkk / lib-python

Blynk IoT library for Python and Micropython
MIT License
237 stars 83 forks source link

Fix reconnect spin when heartbeat fails #16

Closed dave2 closed 5 years ago

dave2 commented 5 years ago

This pull fixes a reconnect loop that happens if the heartbeat fails to be received in time.

Without this, when the library has decided it's lost the server connection, it will spin on reconnects thinking they too are dead before trying to use them.

antohaUa commented 5 years ago

Hi dave2, not sure that I have understood case when we need this. Right now "self._last_send_time changed" within "send" call and "self._last_rcv_time" changed within read_response call - so not clear why we should change them additionally within heartbeat ? Could you please provide more case details here?

dave2 commented 5 years ago

Hmm, I can't now reproduce the issue. I'll withdraw the PR.