Refactored RKReachabilityObserver to work around issues with iOS 5 + host reachability and expand its capabilities. closes #408

* Added support for monitoring by IP address or hostname as well as local Wifi and Internet access generally
* Eliminated usage of synchronous calls to obtain reachability flags during status checks
* Reworked SystemConfiguration reachability callback to cache flags
* RKClient now monitors Internet access instead of hostname based reachability by default. baseURLReachabilityObserver eliminated in favor of reachabilityObserver. It is now a retain property that can be customized
* Queue suspension is now tied to the reachability observer rather than baseURL mutation
This commit is contained in:
Blake Watters
2011-10-18 00:43:25 -04:00
parent eb9dec5953
commit d75fd7d0b0
13 changed files with 951 additions and 492 deletions

View File

@@ -64,8 +64,8 @@ static RKObjectManager* sharedManager = nil;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reachabilityChanged:)
name:RKReachabilityStateChangedNotification
object:_client.baseURLReachabilityObserver];
name:RKReachabilityDidChangeNotification
object:_client.reachabilityObserver];
}
return self;
@@ -115,7 +115,7 @@ static RKObjectManager* sharedManager = nil;
}
- (void)reachabilityChanged:(NSNotification*)notification {
BOOL isHostReachable = [self.client.baseURLReachabilityObserver isNetworkReachable];
BOOL isHostReachable = [self.client.reachabilityObserver isNetworkReachable];
_onlineState = isHostReachable ? RKObjectManagerOnlineStateConnected : RKObjectManagerOnlineStateDisconnected;