Subject: Integrating with other poll mechanisms

Integrating with other poll mechanisms

From: Pawel Veselov via c-ares <c-ares_at_cool.haxx.se>
Date: Thu, 18 May 2017 20:02:30 -0700

Hello.

It seems that integrating c-ares with a main I/O loop that uses select(2) is
really easy. You'd already have fd_sets, so just shove it to ares_fds(),
adjust the maximum if needed, and call select().

Integrating with other polling mechanisms is not that easy. Translating
fd_sets into epoll_ctls or pollfds is a nuisance, mostly because you have
to loop through the fd_sets. Shall the fd values be up there, it's quite a
waste.

Would it be interesting to introduce ares_fds2(ares_channel) that returns a
struct that is a list that has a next, fd, and read/write flags. That would
include. Well, may be there are better ways of presenting this information.

Thank you.
Received on 2017-05-19