Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Testing gethostbyname() blocking

1 view
Skip to first unread message

raseel...@gmail.com

unread,
Feb 19, 2008, 4:15:34 AM2/19/08
to
Hi,

I am planning to replace the gethostbyname() blocking call with the
asynchronous library routines , i.e., libcares.

But, before I do that, how do I go about testing the blocking call ,
and subsequently on replacing with libcares routines, the
asynchronousity (i know ,it;s not even a word)

Thanks,
Raseel
http://www.raseel.in/techblog

Bin Chen

unread,
Feb 19, 2008, 4:18:53 AM2/19/08
to
On Feb 19, 5:15 pm, "raseelbha...@gmail.com" <raseelbha...@gmail.com>
wrote:

> Hi,
>
> I am planning to replace the gethostbyname() blocking call with the
> asynchronous library routines , i.e., libcares.
>
> But, before I do that, how do I go about testing the blocking call ,
> and subsequently on replacing with libcares routines, the
> asynchronousity (i know ,it;s not even a word)
>
Fill a dummy address in /etc/resolv.conf.

James Antill

unread,
Feb 19, 2008, 2:59:29 PM2/19/08
to
On Tue, 19 Feb 2008 01:15:34 -0800, raseel...@gmail.com wrote:

> Hi,
>
> I am planning to replace the gethostbyname() blocking call with the
> asynchronous library routines , i.e., libcares.
>
> But, before I do that, how do I go about testing the blocking call , and
> subsequently on replacing with libcares routines, the asynchronousity (i
> know ,it;s not even a word)

First note that these are not the same thing, so you cannot replace one
with the other directly.

c-ares[1] is an async. DNS resolver library.

gethostbyname() / getaddrinfo() / etc. are functions which resolve a name
to a sockaddr * based on system configuration. This need not use DNS, and
at the very least is likely to include /etc/hosts type lookups as well as
DNS.


[1] Assuming you mean: http://daniel.haxx.se/projects/c-ares/

--
James Antill -- ja...@and.org
C String APIs use too much memory? ustr: length, ref count, size and
read-only/fixed. Ave. 44% overhead over strdup(), for 0-20B strings
http://www.and.org/ustr/

0 new messages