A call to .time() can return a large negative number which results in a rather confusing exception in .settime(). This can occur if an application issues NTP requests too frequently: see this post. I suspect there may also be other circumstances in which an NTP query returns zero.
Another problem reported in discussions is that .time() frequently times out. Clearly the timeout must be short, but this implies that on many networks timeouts will be common.
There are a number of simple fixes. One is for .time() to return an error value in either of these cases which is tested by .settime(). The latter could return a bool indicating success or failure.
A call to
.time()can return a large negative number which results in a rather confusing exception in.settime(). This can occur if an application issues NTP requests too frequently: see this post. I suspect there may also be other circumstances in which an NTP query returns zero.Another problem reported in discussions is that
.time()frequently times out. Clearly the timeout must be short, but this implies that on many networks timeouts will be common.There are a number of simple fixes. One is for
.time()to return an error value in either of these cases which is tested by.settime(). The latter could return aboolindicating success or failure.