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

Re: SCNetworkCheckReachabilityByName


  • Subject: Re: SCNetworkCheckReachabilityByName
  • From: m <email@hidden>
  • Date: Thu, 29 Apr 2004 14:14:06 -0700
  • Resent-date: Thu, 29 Apr 2004 14:14:36 -0700
  • Resent-from: m <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: Cocoa Dev <email@hidden>

Search the archives. I posted some code a few weeks back that definitely works. Note also that the form of your string can affect the results. My code shows the correct form.

_murat


On Apr 29, 2004, at 1:17 PM, Daniel Todd Currie wrote:

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


  • Prev by Date: Solved Re: [Q] am I allowed to call NSTableDataSource informal protocol methods myself?
  • Next by Date: Re: [OT] Towers of Hanoi with four pegs
  • Previous by thread: Re: SCNetworkCheckReachabilityByName
  • Next by thread: Return Code Dilemma
  • Index(es):
    • Date
    • Thread