Subject: handling multiple channels in one select() loop

handling multiple channels in one select() loop

From: Christopher Harvey via c-ares <c-ares_at_cool.haxx.se>
Date: Mon, 02 Oct 2017 21:16:04 -0400

Hi,

I'm new to the c-ares library.

I've created a program with several channels, each with one DNS server.
I want to issue different questions to each channel, and wait for
responses in a single select() loop.

My question is:
When select() returns readable and writeable fd sets, how do I know
which channel to call ares_process on? Even worse, if a timeout occurs,
how can I know which channel the timeout was for?

I have a working single-channel program going now, but I'm not sure how
to extend it.

Thanks,
Chris
Received on 2017-10-03