ev::dispatch: abort on sort::sort nomem
Signed-off-by: Drew DeVault <drew@ddevault.org>
ev::wait: remove error case
It's a programmer error, so assert.
Signed-off-by: Drew DeVault <drew@ddevault.org>
Simplify ev::wait API
By testing for expected error cases upfront.
Signed-off-by: Drew DeVault <drew@ddevault.org>
ev::newloop: allow user to customize event buffer size
Signed-of-by: Drew DeVault <sir@cmpwn.com>
Controll concurrent events priority
This new file.prio parameter give some control to the user over
concurrent events.
Say that a timer expires, but a concurrent event would re-arm it, the
user have no way to predict if the timer callback will trigger.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
timer: make timers NONBLOCK to prevent races
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Fix crashes when triggering events count changes over time
epoll_pwait does not reset the epoll_events after the nevent index. It
means we are re-triggering events. In cases the events are obsoletes,
or the fd closed, we crash on:
assert(pending & ~(op::READV | op::WRITEV) == 0)
We could cleanup the events integer ourselves, but this fix seems
better to me, and more performant anyway.
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
ev: improve documentation of ev::do
And make it clear that the dispatch handler is only called once.
Signed-off-by: Drew DeVault <sir@cmpwn.com>
ev::dial: attempt resolved IPs in order
To handle cases where, for instance, an AAAA record is returned but IPv6
is not available.
Signed-off-by: Drew DeVault <sir@cmpwn.com>
ev::dns: fall back to TCP on response truncation
Signed-off-by: Drew DeVault <sir@cmpwn.com>
ev::dns: update resolv.conf usage
Signed-off-by: Drew DeVault <sir@cmpwn.com>