[Issue #969] Reordering network reachability calls to provide correct reachability status on initialization (/thanks @djmadcat)
This commit is contained in:
parent
c3db232a5e
commit
8916a10dc4
1 changed files with 2 additions and 1 deletions
|
|
@ -367,7 +367,6 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
|
||||
SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
|
||||
SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
|
||||
SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), (CFStringRef)NSRunLoopCommonModes);
|
||||
|
||||
/* Network reachability monitoring does not establish a baseline for IP addresses as it does for hostnames, so if the base URL host is an IP address, the initial reachability callback is manually triggered.
|
||||
*/
|
||||
|
|
@ -379,6 +378,8 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
|||
callback(status);
|
||||
});
|
||||
}
|
||||
|
||||
SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), (CFStringRef)NSRunLoopCommonModes);
|
||||
}
|
||||
|
||||
- (void)stopMonitoringNetworkReachability {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue