diff options
author | Muxi Yan <mxyan@google.com> | 2018-03-19 20:37:28 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-03-26 11:50:10 -0700 |
commit | 6d855c5f3c7518e2b26a97e464ebb9366da05993 (patch) | |
tree | 8e4957ce849ea4c7c711150510f7fbc7dc7e26b9 /src/objective-c/GRPCClient/private/GRPCHost.m | |
parent | bc7e096dd38cd8fca1504986abd2025019004563 (diff) |
Allow gRPC ObjC user to set keepalive options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCHost.m | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 8568e334dd..c282fbd194 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -216,6 +216,11 @@ static NSMutableDictionary *kHostCache; [NSNumber numberWithInt:_compressAlgorithm]; } + if (_keepaliveInterval != 0) { + args[@GRPC_ARG_KEEPALIVE_TIME_MS] = [NSNumber numberWithInt:_keepaliveInterval]; + args[@GRPC_ARG_KEEPALIVE_TIMEOUT_MS] = [NSNumber numberWithInt:_keepaliveTimeout]; + } + id logConfig = [GRPCCall logConfig]; if (logConfig != nil) { args[@GRPC_ARG_MOBILE_LOG_CONFIG] = logConfig; |