Wait, is this peak ?
This commit is contained in:
@@ -303,6 +303,17 @@ class BrokerClient:
|
||||
pass
|
||||
finally:
|
||||
self._client = None
|
||||
|
||||
def ping(self):
|
||||
"""Thread-safe PINGREQ wrapper for MicroPython."""
|
||||
if self._client is None:
|
||||
return
|
||||
if IS_MICROPYTHON:
|
||||
with self._lock:
|
||||
return self._client.ping()
|
||||
else:
|
||||
# Paho handles keepalives automatically via loop_start/loop
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
self.connect()
|
||||
|
||||
Reference in New Issue
Block a user