GRPC C++  1.24.0
Data Structures | Public Member Functions | Friends
grpc_impl::ChannelArguments Class Reference

Options for channel creation. More...

#include <channel_arguments_impl.h>

Public Member Functions

 ChannelArguments ()
 
 ~ChannelArguments ()
 
 ChannelArguments (const ChannelArguments &other)
 
ChannelArgumentsoperator= (ChannelArguments other)
 
void Swap (ChannelArguments &other)
 
void SetChannelArgs (grpc_channel_args *channel_args) const
 Dump arguments in this instance to channel_args. More...
 
void SetSslTargetNameOverride (const grpc::string &name)
 Set target name override for SSL host name checking. More...
 
void SetCompressionAlgorithm (grpc_compression_algorithm algorithm)
 Set the compression algorithm for the channel. More...
 
void SetGrpclbFallbackTimeout (int fallback_timeout)
 Set the grpclb fallback timeout (in ms) for the channel. More...
 
void SetSocketMutator (grpc_socket_mutator *mutator)
 For client channel's, the socket mutator operates on "channel" sockets. More...
 
void SetUserAgentPrefix (const grpc::string &user_agent_prefix)
 Set the string to prepend to the user agent. More...
 
void SetResourceQuota (const grpc::ResourceQuota &resource_quota)
 Set the buffer pool to be attached to the constructed channel. More...
 
void SetMaxReceiveMessageSize (int size)
 Set the max receive and send message sizes. More...
 
void SetMaxSendMessageSize (int size)
 
void SetLoadBalancingPolicyName (const grpc::string &lb_policy_name)
 Set LB policy name. More...
 
void SetServiceConfigJSON (const grpc::string &service_config_json)
 Set service config in JSON form. More...
 
void SetInt (const grpc::string &key, int value)
 Set an integer argument value under key. More...
 
void SetPointer (const grpc::string &key, void *value)
 Set a pointer argument value under key. Owership is not transferred. More...
 
void SetPointerWithVtable (const grpc::string &key, void *value, const grpc_arg_pointer_vtable *vtable)
 
void SetString (const grpc::string &key, const grpc::string &value)
 Set a textual argument value under key. More...
 
grpc_channel_args c_channel_args () const
 Return (by value) a C grpc_channel_args structure which points to arguments owned by this ChannelArguments instance. More...
 

Friends

class grpc_impl::SecureChannelCredentials
 
class grpc::testing::ChannelArgumentsTest
 

Detailed Description

Options for channel creation.

The user can use generic setters to pass key value pairs down to C channel creation code. For gRPC related options, concrete setters are provided.

Constructor & Destructor Documentation

◆ ChannelArguments() [1/2]

grpc_impl::ChannelArguments::ChannelArguments ( )

◆ ~ChannelArguments()

grpc_impl::ChannelArguments::~ChannelArguments ( )

◆ ChannelArguments() [2/2]

grpc_impl::ChannelArguments::ChannelArguments ( const ChannelArguments other)

Member Function Documentation

◆ c_channel_args()

grpc_channel_args grpc_impl::ChannelArguments::c_channel_args ( ) const
inline

Return (by value) a C grpc_channel_args structure which points to arguments owned by this ChannelArguments instance.

◆ operator=()

ChannelArguments& grpc_impl::ChannelArguments::operator= ( ChannelArguments  other)
inline

◆ SetChannelArgs()

void grpc_impl::ChannelArguments::SetChannelArgs ( grpc_channel_args channel_args) const

Dump arguments in this instance to channel_args.

Does not take ownership of channel_args.

Note that the underlying arguments are shared. Changes made to either channel_args or this instance would be reflected on both.

◆ SetCompressionAlgorithm()

void grpc_impl::ChannelArguments::SetCompressionAlgorithm ( grpc_compression_algorithm  algorithm)

Set the compression algorithm for the channel.

◆ SetGrpclbFallbackTimeout()

void grpc_impl::ChannelArguments::SetGrpclbFallbackTimeout ( int  fallback_timeout)

Set the grpclb fallback timeout (in ms) for the channel.

If this amount of time has passed but we have not gotten any non-empty serverlist from the balancer, we will fall back to use the backend address(es) returned by the resolver.

◆ SetInt()

void grpc_impl::ChannelArguments::SetInt ( const grpc::string key,
int  value 
)

Set an integer argument value under key.

◆ SetLoadBalancingPolicyName()

void grpc_impl::ChannelArguments::SetLoadBalancingPolicyName ( const grpc::string lb_policy_name)

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.

◆ SetMaxReceiveMessageSize()

void grpc_impl::ChannelArguments::SetMaxReceiveMessageSize ( int  size)

Set the max receive and send message sizes.

◆ SetMaxSendMessageSize()

void grpc_impl::ChannelArguments::SetMaxSendMessageSize ( int  size)

◆ SetPointer()

void grpc_impl::ChannelArguments::SetPointer ( const grpc::string key,
void *  value 
)

Set a pointer argument value under key. Owership is not transferred.

◆ SetPointerWithVtable()

void grpc_impl::ChannelArguments::SetPointerWithVtable ( const grpc::string key,
void *  value,
const grpc_arg_pointer_vtable vtable 
)

◆ SetResourceQuota()

void grpc_impl::ChannelArguments::SetResourceQuota ( const grpc::ResourceQuota resource_quota)

Set the buffer pool to be attached to the constructed channel.

◆ SetServiceConfigJSON()

void grpc_impl::ChannelArguments::SetServiceConfigJSON ( const grpc::string service_config_json)

Set service config in JSON form.

Primarily meant for use in unit tests.

◆ SetSocketMutator()

void grpc_impl::ChannelArguments::SetSocketMutator ( grpc_socket_mutator mutator)

For client channel's, the socket mutator operates on "channel" sockets.

For server's, the socket mutator operates only on "listen" sockets. TODO(apolcyn): allow socket mutators to also operate on server "channel" sockets, and adjust the socket mutator object to be more speficic about which type of socket it should operate on.

◆ SetSslTargetNameOverride()

void grpc_impl::ChannelArguments::SetSslTargetNameOverride ( const grpc::string name)

Set target name override for SSL host name checking.

This option should be used with caution in production.

◆ SetString()

void grpc_impl::ChannelArguments::SetString ( const grpc::string key,
const grpc::string value 
)

Set a textual argument value under key.

◆ SetUserAgentPrefix()

void grpc_impl::ChannelArguments::SetUserAgentPrefix ( const grpc::string user_agent_prefix)

Set the string to prepend to the user agent.

◆ Swap()

void grpc_impl::ChannelArguments::Swap ( ChannelArguments other)

Friends And Related Function Documentation

◆ grpc::testing::ChannelArgumentsTest

friend class grpc::testing::ChannelArgumentsTest
friend

◆ grpc_impl::SecureChannelCredentials

friend class grpc_impl::SecureChannelCredentials
friend

The documentation for this class was generated from the following file: