Merge pull request #9400 from markdroth/c++_max_message_size_methods

Add ChannelArguments methods for setting max send/recv message size.
pull/9308/head^2
Mark D. Roth 8 years ago committed by GitHub
commit a52c262acc
  1. 4
      include/grpc++/support/channel_arguments.h
  2. 8
      src/cpp/common/channel_arguments.cc

@ -88,6 +88,10 @@ class ChannelArguments {
/// The given buffer pool will be attached to the constructed channel /// The given buffer pool will be attached to the constructed channel
void SetResourceQuota(const ResourceQuota& resource_quota); 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. /// Set LB policy name.
/// Note that if the name resolver returns only balancer addresses, the /// Note that if the name resolver returns only balancer addresses, the
/// grpclb LB policy will be used, regardless of what is specified here. /// grpclb LB policy will be used, regardless of what is specified here.

@ -143,6 +143,14 @@ void ChannelArguments::SetResourceQuota(
grpc_resource_quota_arg_vtable()); 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( void ChannelArguments::SetLoadBalancingPolicyName(
const grpc::string& lb_policy_name) { const grpc::string& lb_policy_name) {
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name); SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);

Loading…
Cancel
Save