• 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
SCNetworkCheckReachabilityByName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SCNetworkCheckReachabilityByName


  • Subject: SCNetworkCheckReachabilityByName
  • From: Daniel Todd Currie <email@hidden>
  • Date: Thu, 29 Apr 2004 13:17:56 -0700

I'm having trouble with SCNetworkCheckReachabilityByName... Here is my implementation:

+ (void)checkVersionAt:(NSString *)versionURLString
withProductPage:(NSString *)productPageURLString
andApplyToWindow:(NSWindow *)versionAlertWindow
showAlerts:(BOOL)showAlerts
{
...

NSLog(@"reachability start");

BOOL success, reachable = 0;
SCNetworkConnectionFlags flags;
success = SCNetworkCheckReachabilityByName([versionURLString UTF8String], &flags);
if((flags & kSCNetworkFlagsReachable) && !(flags & kSCNetworkFlagsConnectionRequired))
{
reachable = 1;
}

NSLog(@"reachability finish = %i %i", success, reachable);

...
}

However, this code always logs the following:

2004-04-29 13:02:53.170 DTCVM Example[1376] reachability start
2004-04-29 13:02:57.323 DTCVM Example[1376] reachability finish = 1 0

My network connection is stable, and I am certain that the URL in versionURLString is valid, since I continue to read the data in that URL, regardless of the results of SCNetworkCheckReachabilityByName. I am hooked up directly to my DSL modem, so I am certain it is not a firewall/etc. issue.

Any ideas would be greatly appreciated.

-- Daniel Currie

PS: Another question is why on earth does the reachability stuff take over 4 seconds on my 768k DSL and 1.33 GHz G4? I don't expect an answer for that one though...
_______________________________________________
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.


  • Follow-Ups:
    • Re: SCNetworkCheckReachabilityByName
      • From: "b.bum" <email@hidden>
  • Prev by Date: Re: Connecting Mulitple Nibs
  • Next by Date: Re: mouse events
  • Previous by thread: Re: [OT] Towers of Hanoi with four pegs
  • Next by thread: Re: SCNetworkCheckReachabilityByName
  • Index(es):
    • Date
    • Thread