• 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: Why would -[NSHost hostWithAddress:] block for so long?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why would -[NSHost hostWithAddress:] block for so long?


  • Subject: Re: Why would -[NSHost hostWithAddress:] block for so long?
  • From: Daniel Jalkut <email@hidden>
  • Date: Fri, 07 Oct 2005 01:50:53 -0400

Hi Dan -

I just added a call to one of my applications, which otherwise doesn't use NSHost at all. I observed a nearly instantaneous reverse lookup in two separate tests. In case there was some sneaky caching at work, I ssh'd to a remote shell account on my ISP's server. I used the nslookup utility on that machine to translate "ibm.com" and "lamonde.fr" into numeric IPs. I then tested hostWithAddress with each of the IPs, and it worked perfectly and quickly.

What happens if you run nslookup from the command line and type in the numeric IP you're getting the delay on? Maybe your DNS servers are just slow to respond, or slow at figuring out what those particular IPs are?

Daniel

On Oct 7, 2005, at 12:33 AM, Dan Wood wrote:

I'm calling -[NSHost hostWithAddress:] in my application, and it seems that the first invocation, this blocks for about 15 seconds!

I don't have a problem with blocking for a moment or two as it accesses the DNS servers out on the net, but fifteen seconds???

The cache methods in NSHost don't seem to have any effect.

Any suggestions? (I suppose I could invoke it in a background thread for its first run when the application is launched...)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Why would -[NSHost hostWithAddress:] block for so long? (From: Dan Wood <email@hidden>)

  • Prev by Date: Why would -[NSHost hostWithAddress:] block for so long?
  • Next by Date: CoreData XML error while saving
  • Previous by thread: Why would -[NSHost hostWithAddress:] block for so long?
  • Next by thread: CoreData XML error while saving
  • Index(es):
    • Date
    • Thread