implementation; ideally it is a monotonic clock. This will generally be
a different clock than :func:`time.time`.
-.. note::
-
- Timeouts (relative *delay* or absolute *when*) should not exceed one day.
-
.. method:: AbstractEventLoop.call_later(delay, callback, *args, context=None)
_HAS_IPv6 = hasattr(socket, 'AF_INET6')
+# Maximum timeout passed to select to avoid OS limitations
+MAXIMUM_SELECT_TIMEOUT = 24 * 3600
+
def _format_handle(handle):
cb = handle._callback
elif self._scheduled:
# Compute the desired timeout.
when = self._scheduled[0]._when
- timeout = max(0, when - self.time())
+ timeout = min(max(0, when - self.time()), MAXIMUM_SELECT_TIMEOUT)
if self._debug and timeout != 0:
t0 = self.time()