Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | * Copyright 2016 gRPC authors. |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
| 19 | #import "GRPCCall+ChannelArg.h" |
| 20 | |
| 21 | #import "private/GRPCHost.h" |
| 22 | |
| 23 | @implementation GRPCCall (ChannelArg) |
| 24 | |
Jorge Canizales | 6af4add | 2016-07-28 23:05:18 -0700 | [diff] [blame] | 25 | + (void)setUserAgentPrefix:(nonnull NSString *)userAgentPrefix forHost:(nonnull NSString *)host { |
Kristopher Wuollett | 20b79e7 | 2016-02-03 21:38:44 -0500 | [diff] [blame] | 26 | GRPCHost *hostConfig = [GRPCHost hostWithAddress:host]; |
| 27 | hostConfig.userAgentPrefix = userAgentPrefix; |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 28 | } |
| 29 | |
Jorge Canizales | 6af4add | 2016-07-28 23:05:18 -0700 | [diff] [blame] | 30 | + (void)setResponseSizeLimit:(NSUInteger)limit forHost:(nonnull NSString *)host { |
| 31 | GRPCHost *hostConfig = [GRPCHost hostWithAddress:host]; |
| 32 | hostConfig.responseSizeLimitOverride = @(limit); |
| 33 | } |
| 34 | |
Jorge Canizales | 4544325 | 2016-04-29 16:19:51 -0700 | [diff] [blame] | 35 | + (void)closeOpenConnections { |
| 36 | [GRPCHost flushChannelCache]; |
| 37 | } |
| 38 | |
Kristopher Wuollett | c6b3017 | 2016-01-31 14:26:39 -0500 | [diff] [blame] | 39 | @end |