GRPC C++
1.30.0
|
Options for channel creation. More...
#include <channel_arguments_impl.h>
Public Member Functions | |
ChannelArguments () | |
~ChannelArguments () | |
ChannelArguments (const ChannelArguments &other) | |
ChannelArguments & | operator= (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 |
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.
grpc_impl::ChannelArguments::ChannelArguments | ( | ) |
grpc_impl::ChannelArguments::~ChannelArguments | ( | ) |
grpc_impl::ChannelArguments::ChannelArguments | ( | const ChannelArguments & | other | ) |
|
inline |
Return (by value) a C grpc_channel_args structure which points to arguments owned by this ChannelArguments instance.
|
inline |
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.
void grpc_impl::ChannelArguments::SetCompressionAlgorithm | ( | grpc_compression_algorithm | algorithm | ) |
Set the compression algorithm for the channel.
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.
void grpc_impl::ChannelArguments::SetInt | ( | const grpc::string & | key, |
int | value | ||
) |
Set an integer argument value under key.
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.
void grpc_impl::ChannelArguments::SetMaxReceiveMessageSize | ( | int | size | ) |
Set the max receive and send message sizes.
void grpc_impl::ChannelArguments::SetMaxSendMessageSize | ( | int | size | ) |
void grpc_impl::ChannelArguments::SetPointer | ( | const grpc::string & | key, |
void * | value | ||
) |
Set a pointer argument value under key. Owership is not transferred.
void grpc_impl::ChannelArguments::SetPointerWithVtable | ( | const grpc::string & | key, |
void * | value, | ||
const grpc_arg_pointer_vtable * | vtable | ||
) |
void grpc_impl::ChannelArguments::SetResourceQuota | ( | const grpc::ResourceQuota & | resource_quota | ) |
Set the buffer pool to be attached to the constructed channel.
void grpc_impl::ChannelArguments::SetServiceConfigJSON | ( | const grpc::string & | service_config_json | ) |
Set service config in JSON form.
Primarily meant for use in unit tests.
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.
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.
void grpc_impl::ChannelArguments::SetString | ( | const grpc::string & | key, |
const grpc::string & | value | ||
) |
Set a textual argument value under key.
void grpc_impl::ChannelArguments::SetUserAgentPrefix | ( | const grpc::string & | user_agent_prefix | ) |
Set the string to prepend to the user agent.
void grpc_impl::ChannelArguments::Swap | ( | ChannelArguments & | other | ) |
|
friend |
|
friend |