aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCHost.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-06-07 18:15:54 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-06-08 17:45:49 -0700
commit9ae3aeb12f32f472177fd8ba9b1f13437f180044 (patch)
tree9bef6c873242fbfaa33946b6775bbea87a8874c0 /src/objective-c/GRPCClient/private/GRPCHost.m
parentfdb72b0bf89c8eecfe14587177abfb039cc22047 (diff)
Do not register connectivity monitor if using CFStream
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index bd5fd94118..ac448d0696 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -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;
}