eclipse / paho.mqtt.python

paho.mqtt.python
Other
2.12k stars 722 forks source link

when client has been disconnected, but client.is_connected() is True #840

Open showfuture opened 1 month ago

showfuture commented 1 month ago

version: 1.6.1 python: 3.9.6

When I'm using paho-mqtt, sometimes in a weak network environment, there is an issue where the MQTT connection is actually disconnected, but according to client.is_connected(), the value is True, indicating that the client is still considered connected. I cannot rely on client.is_connected() to determine the connection status, which has led to significant bugs in my business logic. How can I solve this problem?

JiajiaHuang commented 2 weeks ago

Version: 1.6.1 and 2.1.0 The same problem exists, causing BUG.