channel creation API change

pull/3104/head
yang-g 9 years ago
parent 967caaada0
commit dafcce980d
  1. 6
      include/grpc++/create_channel.h
  2. 8
      src/cpp/client/create_channel.cc

@ -44,6 +44,12 @@ namespace grpc {
// If creds does not hold an object or is invalid, a lame channel is returned.
std::shared_ptr<Channel> CreateChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds);
// For advanced use and testing ONLY. Override default channel arguments only
// if necessary.
// If creds does not hold an object or is invalid, a lame channel is returned.
std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args);

@ -43,7 +43,12 @@
namespace grpc {
class ChannelArguments;
std::shared_ptr<Channel> CreateChannel(
std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds) {
return CreateCustomChannel(target, creds, ChannelArguments());
}
std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args) {
ChannelArguments cp_args = args;
@ -57,4 +62,5 @@ std::shared_ptr<Channel> CreateChannel(
NULL, GRPC_STATUS_INVALID_ARGUMENT,
"Invalid credentials."));
}
} // namespace grpc

Loading…
Cancel
Save