diff options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCHost.m | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 348989904a..2e9f9f243b 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -85,6 +85,7 @@ static NSMutableDictionary *kHostCache; _secure = YES; kHostCache[address] = self; _compressAlgorithm = GRPC_COMPRESS_NONE; + _retryEnabled = YES; } #ifndef GRPC_CFSTREAM [GRPCConnectivityMonitor registerObserver:self selector:@selector(connectivityChange:)]; @@ -240,6 +241,20 @@ static NSMutableDictionary *kHostCache; args[@GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER] = [NSNumber numberWithInt:1]; } + if (_retryEnabled == NO) { + args[@GRPC_ARG_ENABLE_RETRIES] = [NSNumber numberWithInt:0]; + } + + if (_minConnectTimeout > 0) { + args[@GRPC_ARG_MIN_RECONNECT_BACKOFF_MS] = [NSNumber numberWithInt:_minConnectTimeout]; + } + if (_initialConnectBackoff > 0) { + args[@GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS] = [NSNumber numberWithInt:_initialConnectBackoff]; + } + if (_maxConnectBackoff > 0) { + args[@GRPC_ARG_MAX_RECONNECT_BACKOFF_MS] = [NSNumber numberWithInt:_maxConnectBackoff]; + } + return args; } |