adafruit / Adafruit_CircuitPython_MiniMQTT

MQTT Client Library for CircuitPython
Other
80 stars 49 forks source link

if broker is down, minmqtt behavior could be made simpler to recover #149

Closed schaefer01 closed 1 year ago

schaefer01 commented 1 year ago

hi, when the broker is down, there's no clean way to access the socket to close and retry if the socket isn't closed, each retry grabs a new socket until there are no more sockets and then a no more sockets exception is raised

I see the call .disconnect() but there is nothing to disconnect from, and the call will raise the exception, not connected.

the socket variable needed to perform the close is self._sock

there should either be an automatic cleanup or a call to close the socket without having to dig down into a semi-private class variable.

bob s.

vladak commented 1 year ago

Actually, reconnect() closes the socket in the process of reconnecting.

schaefer01 commented 1 year ago

thank you