Do not register connectivity monitor if using CFStream

pull/15696/head
Muxi Yan 7 years ago
parent fdb72b0bf8
commit 9ae3aeb12f
  1. 5
      src/objective-c/GRPCClient/GRPCCall.m
  2. 4
      src/objective-c/GRPCClient/private/GRPCHost.m
  3. 2
      src/objective-c/tests/Connectivity/ConnectivityTestingApp/ViewController.m

@ -206,8 +206,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
} else {
[_responseWriteable enqueueSuccessfulCompletion];
}
#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
#endif
// If the call isn't retained anywhere else, it can be deallocated now.
_retainSelf = nil;
@ -462,7 +463,9 @@ static NSString *const kBearerPrefix = @"Bearer ";
[self sendHeaders:_requestHeaders];
[self invokeCall];
#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChanged:)];
#endif
}
- (void)startWithWriteable:(id<GRXWriteable>)writeable {

@ -49,7 +49,9 @@ static NSMutableDictionary *kHostCache;
if (_channelCreds != nil) {
grpc_channel_credentials_release(_channelCreds);
}
#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor unregisterObserver:self];
#endif
}
// Default initializer.
@ -84,7 +86,9 @@ static NSMutableDictionary *kHostCache;
kHostCache[address] = self;
_compressAlgorithm = GRPC_COMPRESS_NONE;
}
#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChange:)];
#endif
}
return self;
}

@ -35,7 +35,9 @@ NSString *host = @"grpc-test.sandbox.googleapis.com";
- (void)viewDidLoad {
[super viewDidLoad];
#ifndef GRPC_CFSTREAM
[GRPCConnectivityMonitor registerObserver:self selector:@selector(reachabilityChanged:)];
#endif
}
- (void)reachabilityChanged:(NSNotification *)note {

Loading…
Cancel
Save