Reachability.Reachability.IsNetworkAvailable C# (CSharp) Method

IsNetworkAvailable() static private method

static private IsNetworkAvailable ( NetworkReachabilityFlags &flags ) : bool
flags NetworkReachabilityFlags
return bool
		static bool IsNetworkAvailable (out NetworkReachabilityFlags flags)
		{
			if (defaultRouteReachability == null) {
				var ipAddress = new IPAddress (0);
				defaultRouteReachability = new NetworkReachability (ipAddress.MapToIPv6 ());
				defaultRouteReachability.SetNotification (OnChange);
				defaultRouteReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault);
			}
			return defaultRouteReachability.TryGetFlags (out flags) && IsReachableWithoutRequiringConnection (flags);
		}