Subject: [Newbie] some c-ares clarifications sought

[Newbie] some c-ares clarifications sought

From: <izimmerman_at_borderware.com>
Date: 2006-01-06

Hello there, first, if there's a FAQ, I should probably read it first,
so point me to it and ignore the rest :-)

I am evaluating c-ares for use in our projects. Looking at the manpages
it's a quite close match, but not perfect. Some questions I can't
quite answer from the manpages:

1/ In our applications, we typically need more detailed access to the
DNS answers than through gethostbyname(); i.e. the TTL for each answer,
at the very least. But the only interface c-ares provides seems to be
basically asynchronous gethostbyname(), or else I have to parse the DNS
packets myself. Is this right? Would code to parse DNS replies be a
welcome contribution to cares? Or is something planned already?

2/ It is not clear from the manpages if a c-ares channel acquires
an associated socket file descriptor(s) for life, or a new one for
each query. That is, will ares_fds(chan, &r, &w) always set the same
fds in r and w for the same chan? I'd much rather determine these
descriptors once at startup. This is because I need to select() on
other descriptors too, and I need to do different things depending
on which descriptors (c-ares and multiple "kinds" of others) are ready;
so I need to remember the "kind" of each descriptor, which is tough
if they are different each time :-(

3/ Similarly, will ares_getsock(chan, socks, n) always set the same
things in socks for a given chan? Actually ares_getsock isn't even
declared in the version of ares.h that I have, which has the CVS Id
"ares.h,v 1.15 2005/08/18 08:48:31 bagder". I guess this function been
added in a newer version of the library. Is there a moderately stable
version tagged in the CVS (i.e. not the nightly snapshot)?

tia
Received on Fri Jan 6 23:15:02 2006