diff options
author | Muxi Yan <mxyan@google.com> | 2019-01-02 15:52:42 -0800 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2019-01-02 15:52:42 -0800 |
commit | 1f3829180c32c8c2ee1a3d546d6c2bcb3287e312 (patch) | |
tree | 2cfa1260fffe2b867f1cec0e1041f20faa45624e | |
parent | 291b4f363bbf7226eb7a3bbd7ad620f5be67c625 (diff) |
Fix missing ConnectivityMonitor usage
-rw-r--r-- | src/objective-c/GRPCClient/GRPCCall.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index b0412cddb0..83c6edc6e3 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -841,6 +841,12 @@ const char *kCFStreamVarName = "grpc_cfstream"; [self sendHeaders]; [self invokeCall]; + + // Connectivity monitor is not required for CFStream + char *enableCFStream = getenv(kCFStreamVarName); + if (enableCFStream == nil || enableCFStream[0] != '1') { + [GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChanged:)]; + } } - (void)startWithWriteable:(id<GRXWriteable>)writeable { |