• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: straight-C DNS lookup with timeout?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: straight-C DNS lookup with timeout?


  • Subject: Re: straight-C DNS lookup with timeout?
  • From: Philip George <email@hidden>
  • Date: Thu, 2 Jan 2003 16:17:30 -0600

Thanks, Chris. That's a great idea. I'd still rather use non-platform-specific API's though, because this app is going to be ported to Windows, Linux, and BeOS. I'd like to have all the networking backend stuff as portable as possible, so that all I have to do is change the GUI code (and add a little WinSock code to the Windows version).

- Philip


On Thursday, January 2, 2003, at 10:12 AM, Chris Hanson wrote:

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.
_______________________________________________
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.

References: 
 >Re: straight-C DNS lookup with timeout? (From: Chris Hanson <email@hidden>)

  • Prev by Date: NSMutableDictionary Q's
  • Next by Date: System information
  • Previous by thread: Re: straight-C DNS lookup with timeout?
  • Next by thread: Re: straight-C DNS lookup with timeout?
  • Index(es):
    • Date
    • Thread