Skip to content

Commit

Permalink
Add ChannelArguments methods for setting max send/recv message size.
Browse files Browse the repository at this point in the history
  • Loading branch information
markdroth committed Jan 19, 2017
1 parent 73b20e6 commit f0e1778
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/grpc++/support/channel_arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ class ChannelArguments {
/// The given buffer pool will be attached to the constructed channel
void SetResourceQuota(const ResourceQuota& resource_quota);

/// Sets the max receive and send message sizes.
void SetMaxReceiveMessageSize(int size);
void SetMaxSendMessageSize(int size);

/// Set LB policy name.
/// Note that if the name resolver returns only balancer addresses, the
/// grpclb LB policy will be used, regardless of what is specified here.
Expand Down
8 changes: 8 additions & 0 deletions src/cpp/common/channel_arguments.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ void ChannelArguments::SetResourceQuota(
grpc_resource_quota_arg_vtable());
}

void ChannelArguments::SetMaxReceiveMessageSize(int size) {
SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, size);
}

void ChannelArguments::SetMaxSendMessageSize(int size) {
SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, size);
}

void ChannelArguments::SetLoadBalancingPolicyName(
const grpc::string& lb_policy_name) {
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);
Expand Down

0 comments on commit f0e1778

Please sign in to comment.