|
|
|
@ -45,10 +45,11 @@ |
|
|
|
|
namespace grpc { |
|
|
|
|
|
|
|
|
|
static internal::GrpcLibraryInitializer g_gli_initializer; |
|
|
|
|
Channel::Channel(const grpc::string& host, grpc_channel* channel, |
|
|
|
|
std::vector<std::unique_ptr< |
|
|
|
|
experimental::ClientInterceptorFactoryInterface>> |
|
|
|
|
interceptor_creators) |
|
|
|
|
Channel::Channel( |
|
|
|
|
const grpc::string& host, grpc_channel* channel, |
|
|
|
|
std::vector< |
|
|
|
|
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>> |
|
|
|
|
interceptor_creators) |
|
|
|
|
: host_(host), c_channel_(channel) { |
|
|
|
|
interceptor_creators_ = std::move(interceptor_creators); |
|
|
|
|
g_gli_initializer.summon(); |
|
|
|
@ -64,8 +65,7 @@ Channel::~Channel() { |
|
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
inline grpc_slice SliceFromArray(const char* arr, size_t len) { |
|
|
|
|
return g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, |
|
|
|
|
len); |
|
|
|
|
return g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, len); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
grpc::string GetChannelInfoField(grpc_channel* channel, |
|
|
|
@ -103,9 +103,10 @@ void ChannelResetConnectionBackoff(Channel* channel) { |
|
|
|
|
|
|
|
|
|
} // namespace experimental
|
|
|
|
|
|
|
|
|
|
internal::Call Channel::CreateCallInternal( |
|
|
|
|
const internal::RpcMethod& method, ClientContext* context, |
|
|
|
|
CompletionQueue* cq, size_t interceptor_pos) { |
|
|
|
|
internal::Call Channel::CreateCallInternal(const internal::RpcMethod& method, |
|
|
|
|
ClientContext* context, |
|
|
|
|
CompletionQueue* cq, |
|
|
|
|
size_t interceptor_pos) { |
|
|
|
|
const bool kRegistered = method.channel_tag() && context->authority().empty(); |
|
|
|
|
grpc_call* c_call = nullptr; |
|
|
|
|
if (kRegistered) { |
|
|
|
@ -149,9 +150,9 @@ internal::Call Channel::CreateCallInternal( |
|
|
|
|
return internal::Call(c_call, this, cq, info); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::grpc::internal::Call Channel::CreateCall( |
|
|
|
|
const internal::RpcMethod& method, ClientContext* context, |
|
|
|
|
CompletionQueue* cq) { |
|
|
|
|
::grpc::internal::Call Channel::CreateCall(const internal::RpcMethod& method, |
|
|
|
|
ClientContext* context, |
|
|
|
|
CompletionQueue* cq) { |
|
|
|
|
return CreateCallInternal(method, context, cq, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|