adafruit / Adafruit_CircuitPython_NTP

Network Time Protocol (NTP) Helper for CircuitPython
MIT License
9 stars 18 forks source link

Fixed hanging by adding socket_timeout parameter with a default timeout of 10s #22

Closed regulatre closed 2 years ago

regulatre commented 2 years ago

Inevitably network connections will let us down and reads will fail. To prevent indefinite hanging in this situation we can now rely on a default read timeout of 10s. The default value can also be overridden by instantiating the class with the new value specified as socket_timeout. Credit to @mattura for the suggestion.