Subject: Re: [Newbie] some c-ares clarifications sought

Re: [Newbie] some c-ares clarifications sought

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

Ian> Well, once select() returns and i see a bit set in my reads[], how
Ian> do I know it's an ares socket as opposed to mine (and I have
Ian> multiple knids of mine)?

Daniel> You'd just have to assume that if it isn't your file descriptor
Daniel> then it belongs to c-ares. You know what descriptors that are
Daniel> yours, right?

Daniel> Or else, you call ares_fdset() and check what bits it set and
Daniel> remember that those bits are for c-ares. Or similar.

ares_fdset? Do you mean ares_fds?

That won't do it. ares_getsock would, but it does mean getting the CVS;
oh well, I guess I have to do that anyway to contribute the DNS packet
code, but I'll have to convince the superiors it's safe. Or should I
wait for the next release?

You see, the natural algorithm in this situation is _not_ to go through
all bits in reads[] and test each; that's too wasteful of time. The
natural way is to know the descriptors you have open, and test those
bits only.

-- 
Ian Zimmerman, Software Engineer
BorderWare Technologies, Inc.
Mississauga, Ontario, Canada
Received on Mon Jan 9 16:55:16 2006