I'm using NetworkReachability
to figure out the connectivity status of my app:
NetworkReachability(this.currentHostUrl);
remoteHostReachability.SetNotification(this.ReachabilityChanged);
remoteHostReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
The callback method looks like this:
void ReachabilityChanged(NetworkReachabilityFlags flags)
{
this.reachable = (flags & NetworkReachabilityFlags.Reachable) > 0;
UIHelpers.GetAppDelegate().UpdateConnectivityToast(this.reachable);
}
Now if I switch to airplane mode, the callback gets called immediately and the flags parameter is 0. Then, shortly after it triggers again and the flags are
ConnectionRequired|IsWWAN|Reachable|TransientConnection
If I turn airplane mode off, I get another 0 and then afterwards
Reachable
If I turn WiFi off and 3G kicks in, the result is:
IsWWAN|Reachable|TransientConnection
It seems like checking for Reachable
alone is not enough. But what's the logic here? What do ConnectionRequired
and TransientConnection
mean?