Re: straight-C DNS lookup with timeout?
Re: straight-C DNS lookup with timeout?
- Subject: Re: straight-C DNS lookup with timeout?
- From: Chris Hanson <email@hidden>
- Date: Thu, 2 Jan 2003 10:12:30 -0600
At 4:09 AM -0600 12/30/02, Philip George wrote:
I'm using gethostbyaddr() right now, but I'm open for any straight-C
suggestions. I must set a quicker timeout on the lookup. The
default timeout is way too long for gethostbyaddr().
Can you use Carbon's OTLookupName? OTLookupName lets you specify a
time-out, and can even do asynchronous name lookups.
The big advantage to doing this rather than rolling your own DNS
lookup library or using someone else's is that you'll still be going
through the operating system's name-lookup mechanism. So
*everything* will be found regardless of whether it's being retrieved
from DNS, Rendezvous, NetInfo, OpenDirectory, flat files, AppleTalk,
some custom lookup agent, etc.
To get any real docs on OTLookupName and how to use it, you'll have
to look at "Inside Macintosh: Networking with Open Transport" in the
Mac OS 9 documentation on Apple's web site. There's also probably
some Mac OS 9 sample code you could look at and Carbonize to play
with and see if it'll work for your needs on Mac OS X.
-- Chris
-- insert minor rant here about how much more modern
and flexible Open Transport is than BSD sockets
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.