• 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: NSHost currentHost Slow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSHost currentHost Slow


  • Subject: Re: NSHost currentHost Slow
  • From: John Tsombakos <email@hidden>
  • Date: Tue, 4 Jan 2005 09:09:48 -0500


On Jan 4, 2005, at 3:08 AM, j o a r wrote:


On 2005-01-04, at 07.23, John Tsombakos wrote:

I'm trying to track down this problem. It started with Safari taking a long time connecting to websites. (I enter a URL, hit return and the status line says "Connecting to...." for several seconds - up to almost a minute in some cases). (This is OS X 10.3.7, btw)

This was recently discussed in a thread named "[NSHost currenthost] slooooooooooow" by Henk Kampman. Some people see this problem, others don't. It has to be related to your network configuration in one way or another.



I did see that thread. The point where some people see it and others don't was discussed on the Apple discussion list. It was pointed out that the problem showed up when your router gives out (via DHCP) addresses in the 192.168.x.x range, and didn't if the router gives 10.x.x.x addresses. Also, this happens on a couple of machines - an iMac, an iBook and a G5. All network settings are pretty much the default.


Mac OS X 10.3.5 - 10.3.6 had bug where DNS lookups would time out too quickly and return a failure to resolve the requested hostname. This bug was fixed in 10.3.7, and the fix is without a doubt linked to the appearance of this problem.


As a point of info, I still do see a problem when using Safari that was not fixed with 10.3.7 - clicking a link on a page will immediately return a "Safari can't find this page" error sheet. Clicking the link again then works fine... I'm thinking it's not quite fixed.


[h release];

Don't do this - h is an autoreleased object. This is a bug, and it will affect your results.



Disclaimer: not responsible for dumb mistakes in sample code :) Another sample didn't do the release and still shows the problem.


Here are my sample times.. you can see the first call takes upwards of 10 seconds:

[farside:~/Devel] john% ./a.out
2005-01-04 01:14:29.286 a.out[542] Time elapsed: 5.073724
2005-01-04 01:14:29.287 a.out[542] Time elapsed: 0.000212
My results typically looks like this:

2005-01-04 08:56:48.880 NSHostTest[1508] Time elapsed: 0.010992
2005-01-04 08:56:48.882 NSHostTest[1508] Time elapsed: 0.000022


That's what my results sometimes show too. But when I'm having the problem, they look like what I posted.


This may be a bit off topic, but since it's NSHost that seems to be the problem, I figured I'd post my findings.

What if you print this:

	NSLog(@"%@\nTime elapsed: %f", h, [end timeIntervalSinceDate:start]);

My host looks something like this:


That's pretty much what I get too. As a point of info, I've tried the test with IPv6 turned on and off. (Turning IPv6 off was suggested as a work around of the problem.)


j o a r



Thanks! john.

_______________________________________________
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


  • Follow-Ups:
    • Re: NSHost currentHost Slow
      • From: j o a r <email@hidden>
References: 
 >NSHost currentHost Slow (From: John Tsombakos <email@hidden>)
 >Re: NSHost currentHost Slow (From: j o a r <email@hidden>)

  • Prev by Date: NSArrayController for unordered collection (a Set)
  • Next by Date: Re: NSHost currentHost Slow
  • Previous by thread: Re: NSHost currentHost Slow
  • Next by thread: Re: NSHost currentHost Slow
  • Index(es):
    • Date
    • Thread