Re: Is the internet avaliable question
Re: Is the internet avaliable question
- Subject: Re: Is the internet avaliable question
- From: m <email@hidden>
- Date: Fri, 2 Apr 2004 12:16:47 -0800
On Apr 2, 2004, at 9:55 AM, Daniel Todd Currie wrote:
that still doesn't resolve the firewall issue brought up in the
article... I have been playing around with the reachability API for a
couple weeks, and it has not once worked through my router, and I'm
pretty sure that at some point I have coded it all correctly.
Are you saying that there are cases when the reachability tells you a
URL is not reachable when in fact you can reach it by using a browser?
If so, I've never had this problem...
here's code that works for me:
- (BOOL)networkConnectionOK
{
BOOL result = NO;
SCNetworkConnectionFlags flags;
// IMPORTANT:
// To work with CodeWarrior you should set the
// "enums are always int" option, which the CWPro8
// Mach-O stationery fails to do.
assert(sizeof(SCNetworkConnectionFlags) == sizeof(int));
if ( SCNetworkCheckReachabilityByName("muratnkonar.com", &flags) )
{
result = !(flags & kSCNetworkFlagsConnectionRequired) && (flags
& kSCNetworkFlagsReachable);
}
return result;
}
_murat
_murat
_______________________________________________
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.