GRPC C++  1.13.0-dev
Data Structures | Public Member Functions | Friends
grpc::ChannelArguments Class Reference

Options for channel creation. More...

#include <channel_arguments.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 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 SecureChannelCredentials
 
class 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::ChannelArguments::ChannelArguments ( )

◆ ~ChannelArguments()

grpc::ChannelArguments::~ChannelArguments ( )

◆ ChannelArguments() [2/2]

grpc::ChannelArguments::ChannelArguments ( const ChannelArguments other)

Member Function Documentation

◆ c_channel_args()

grpc_channel_args grpc::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::ChannelArguments::operator= ( ChannelArguments  other)
inline

◆ SetChannelArgs()

void grpc::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::ChannelArguments::SetCompressionAlgorithm ( grpc_compression_algorithm  algorithm)

Set the compression algorithm for the channel.

◆ SetGrpclbFallbackTimeout()

void grpc::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::ChannelArguments::SetInt ( const grpc::string key,
int  value 
)

Set an integer argument value under key.

◆ SetLoadBalancingPolicyName()

void grpc::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::ChannelArguments::SetMaxReceiveMessageSize ( int  size)

Set the max receive and send message sizes.

◆ SetMaxSendMessageSize()

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

◆ SetPointer()

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

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

◆ SetPointerWithVtable()

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

◆ SetResourceQuota()

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

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

◆ SetServiceConfigJSON()

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

Set service config in JSON form.

Primarily meant for use in unit tests.

◆ SetSocketMutator()

void grpc::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::ChannelArguments::SetSslTargetNameOverride ( const grpc::string name)

Set target name override for SSL host name checking.

This option is for testing only and should never be used in production.

◆ SetString()

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

Set a textual argument value under key.

◆ SetUserAgentPrefix()

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

Set the string to prepend to the user agent.

◆ Swap()

void grpc::ChannelArguments::Swap ( ChannelArguments other)

Friends And Related Function Documentation

◆ SecureChannelCredentials

friend class SecureChannelCredentials
friend

◆ testing::ChannelArgumentsTest

friend class testing::ChannelArgumentsTest
friend

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