[MonoTouch] Reachability

danmiser danmiser at gmail.com
Fri Mar 2 17:43:31 UTC 2012


Before I create a test case to submit to bugzilla, would anyone care to tell
me I'm nuts first? :)

>From here:
https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs

public static NetworkStatus InternetConnectionStatus ()	{		
  NetworkReachabilityFlags flags;		
  bool defaultNetworkAvailable = IsNetworkAvaialable (out flags);		
  if (defaultNetworkAvailable){ ***
    if ((flags & NetworkReachabilityFlags.IsDirect) != 0)				
      return NetworkStatus.NotReachable;		
    } else if ((flags & NetworkReachabilityFlags.IsWWAN) != 0)			
      return NetworkStatus.ReachableViaCarrierDataNetwork;		
  return NetworkStatus.ReachableViaWiFiNetwork;	
}

Shouldn't the line marked with *** above actually be
if (!defaultNetworkAvailable)

When I go into Airplane mode, the IsNetworkAvailable call is returning
false, but that means the return code will be
NetworkStatus.ReachableViaWiFiNetwork in that case.


--
View this message in context: http://monotouch.2284126.n4.nabble.com/Reachability-tp4439227p4439227.html
Sent from the MonoTouch mailing list archive at Nabble.com.


More information about the MonoTouch mailing list