Subject: Re: ares-fds

Re: ares-fds

From: Nitin Bhardwaj <mcabhardwaj_at_gmail.com>
Date: Fri, 4 Apr 2008 16:28:59 +0530

>From: Naveen Shivanna
<naveen.81_at_gmail.com<naveen.81_at_gmail.com?Subject=Re:%20ares-fds>>

>Date: Fri, 4 Apr 2008 13:58:39 +0530
**
*>Could u please provide an example program to how we can use ares_getsock
to
>get the individual socket fds and use in our user application, where i am
>creating a thread for our stack, instead of the stack creating the thread
>i.e we are trying to give an option of user creating a thread and waiting
>for the event to select on. *

Hi Naveen,

When we initialize the c-ares library, using ares_init(), we get a OUT value
of type *ares_channel* .
You can call ares_getsock() on that channel ID, to get a list of socket
descriptors which are being used by c-ares library in that channel. This
list of socket fds can then be given to application - for whatever handling
it wants to do on it.

Regards,
Nitin Bhardwaj.
Received on 2008-04-04