-
Notifications
You must be signed in to change notification settings - Fork 419
Closed
Labels
bugThis issue is a bug.This issue is a bug.
Description
I'm trying to write a small script that isn't guaranteed to have internet access on startup and can sometimes lose internet unexpectedly.
When there is no internet, the socket will fail to connect (as expected) due to name resolution not being available. A socket error is raised.
If connect is called again, the error will be raised again, but the processor utilization will increase.
This will continue to occur until the operating system denies you the ability to create threads.
e.x.
while True:
try:
mqttclient.connect()
break
except:
sleep(10)
continue
Things I've tried:
- Calling disconnect after a failed connect
- Only calling connect once. Once internet is established, publish never works
- Deleting mqttclient and re-creating it
Connect will have to be called again, since socket lifetimes are limited to 24 hours.
Related: #39 #124
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.