You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using the library in a long-running script where I frequently connect/disconnect to brokers. After a few hours/days, I cannot connect anymore due to "too many open files" error. In fact after checking the open sockets with lsof I end up with hundreds of open sockets when idle.
It seems the MQTT client class relies on __del__ method (and thus in the garbage collector) to close the sockets, which gives unpredictable results. Is there any way to force close the sockets when disconnecting? I was thinking maybe exporting the _reset_sockets method?
Thanks
The text was updated successfully, but these errors were encountered:
I am experiencing the same issue I am performing a test where I disconnect from the broker every 30 seconds this left too many open sockets which is not getting closed in my case.
I'm going to close this due to inactivity (the library has changed since this was raised). Please feel free to reopen, but if you do please provide a minimal example and details about your environment (OS etc).
Hello,
I'm using the library in a long-running script where I frequently connect/disconnect to brokers. After a few hours/days, I cannot connect anymore due to "too many open files" error. In fact after checking the open sockets with
lsof
I end up with hundreds of open sockets when idle.It seems the MQTT client class relies on
__del__
method (and thus in the garbage collector) to close the sockets, which gives unpredictable results. Is there any way to force close the sockets when disconnecting? I was thinking maybe exporting the_reset_sockets
method?Thanks
The text was updated successfully, but these errors were encountered: