aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCHost.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-12-21 16:52:39 -0800
committerGravatar Muxi Yan <mxyan@google.com>2017-12-21 17:03:24 -0800
commitc47b3f5c3afa57ccb2bb64426f1aa91ecf6d4bfe (patch)
treeffc2af1410c6e27451682cc8ae3208e8677552bc /src/objective-c/GRPCClient/private/GRPCHost.m
parentd55110b91571e362ddd1f78848a8a30ff61d3c47 (diff)
Add interface to API to enable compression
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index a0f4118740..665943f181 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -87,6 +87,7 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil;
_address = address;
_secure = YES;
kHostCache[address] = self;
+ _compressAlgorithm = GRPC_COMPRESS_NONE;
}
// Keep a single monitor to flush the cache if the connectivity status changes
// Thread safety guarded by @synchronized(kHostCache)
@@ -226,6 +227,12 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil;
}
// Use 10000ms initial backoff time for correct behavior on bad/slow networks
args[@GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS] = @10000;
+
+ if (_compressAlgorithm != GRPC_COMPRESS_NONE) {
+ args[@GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM] =
+ [NSNumber numberWithInt:_compressAlgorithm];
+ }
+
return args;
}