Permalink
Browse files

fixes issue AFNetworking#3014

  • Loading branch information...
mobitar committed Sep 29, 2015
1 parent fbd2bc8 commit 4829c0b012f36c280efca135eaf4d4e782426be0
@@ -63,7 +63,7 @@ - (instancetype)initWithBaseURL:(NSURL *)url {
self.securityPolicy = [AFSecurityPolicy defaultPolicy];
self.reachabilityManager = [AFNetworkReachabilityManager sharedManager];
self.reachabilityManager = [AFNetworkReachabilityManager manager];
self.operationQueue = [[NSOperationQueue alloc] init];
@@ -81,6 +81,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (instancetype)sharedManager;
/**
Creates and returns a network reachability manager with the default socket address.
@return An initialized network reachability manager, actively monitoring the default socket address.
*/
+ (instancetype)manager;
/**
Creates and returns a network reachability manager for the specified domain.
@@ -115,12 +115,7 @@ + (instancetype)sharedManager {
static AFNetworkReachabilityManager *_sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
struct sockaddr_in address;
bzero(&address, sizeof(address));
address.sin_len = sizeof(address);
address.sin_family = AF_INET;
_sharedManager = [self managerForAddress:&address];
_sharedManager = [self manager];
});
return _sharedManager;
@@ -144,6 +139,15 @@ + (instancetype)managerForAddress:(const void *)address {
return manager;
}
+ (instancetype)manager
{
struct sockaddr_in address;
bzero(&address, sizeof(address));
address.sin_len = sizeof(address);
address.sin_family = AF_INET;
return [self managerForAddress:&address];
}
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
self = [super init];
if (!self) {

0 comments on commit 4829c0b

Please sign in to comment.