Description
socket_timeout
is period which the underlying implementation will break out from a "select" loop, "recv_timeout" should be the maximum period for which to wait for data from the server. _sock_exact_recv()
however uses keep_alive
as a receive timeout:
Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Lines 1118 to 1127 in 1c25441
By default socket_timeout
is 1 second, recv_timeout
is 10 seconds and keep_alive
is 60 seconds.
As a result, when a server disconnects the client and the client pings it, it will take 60 seconds for the client to discover that the connection is unresponsive. Instead, recv_timeout
should be used. The way I understand it is that keep alive is server side feature and should not trump receive timeout on the client.
The fix would simplify the various No data ...
MMQTTException
s used throughout the code.