开发者

Reachability takes too long to fail when connected to WIFI without internet

Hi there I have been using reachability class and everything works f开发者_StackOverflow社区ine; except for ...

When the device is connected to wifi, and for whatever reason, the wifi router does not have internet connectivity the reachability class takes too long to say that there is no internet.

It works well(fast!) when there is no network/internet connectivity at all, for instance, if the wifi is off and the device does not have a 3G connection, reachability class returns success/failure almost instantly.

To re-iterate, connected to a wifi router, where there is no internet connectivity almost takes a full minute for reachability class to return a status.

Reachability *reachability=[Reachability reachabilityWithHostName:@"www.google.com"];
    NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
    if(remoteHostStatus == NotReachable) { 
 ............

My Code

Any suggestions?

Thanks


i just tried this

Reachability *reachability=[Reachability reachabilityForInternetConnection];

Looks like it works! Since i just wanted to see if the internet is available or not

Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜