blob: 398d98fbc7a6c849310578541c78e40814a98b48 [file] [log] [blame]
Kristopher Wuollettc6b30172016-01-31 14:26:39 -05001/*
2 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003 * Copyright 2016 gRPC authors.
Kristopher Wuollettc6b30172016-01-31 14:26:39 -05004 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02005 * 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 Wuollettc6b30172016-01-31 14:26:39 -05008 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009 * http://www.apache.org/licenses/LICENSE-2.0
Kristopher Wuollettc6b30172016-01-31 14:26:39 -050010 *
Jan Tattermusch7897ae92017-06-07 22:57:36 +020011 * 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 Wuollettc6b30172016-01-31 14:26:39 -050016 *
17 */
18
19#import "GRPCCall+ChannelArg.h"
20
21#import "private/GRPCHost.h"
22
23@implementation GRPCCall (ChannelArg)
24
Jorge Canizales6af4add2016-07-28 23:05:18 -070025+ (void)setUserAgentPrefix:(nonnull NSString *)userAgentPrefix forHost:(nonnull NSString *)host {
Kristopher Wuollett20b79e72016-02-03 21:38:44 -050026 GRPCHost *hostConfig = [GRPCHost hostWithAddress:host];
27 hostConfig.userAgentPrefix = userAgentPrefix;
Kristopher Wuollettc6b30172016-01-31 14:26:39 -050028}
29
Jorge Canizales6af4add2016-07-28 23:05:18 -070030+ (void)setResponseSizeLimit:(NSUInteger)limit forHost:(nonnull NSString *)host {
31 GRPCHost *hostConfig = [GRPCHost hostWithAddress:host];
32 hostConfig.responseSizeLimitOverride = @(limit);
33}
34
Jorge Canizales45443252016-04-29 16:19:51 -070035+ (void)closeOpenConnections {
36 [GRPCHost flushChannelCache];
37}
38
Kristopher Wuollettc6b30172016-01-31 14:26:39 -050039@end