MCPcopy Create free account
hub / github.com/apache/brpc / SetUpChannel

Method SetUpChannel

test/brpc_channel_unittest.cpp:329–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327 }
328
329 void SetUpChannel(brpc::Channel* channel,
330 bool single_server,
331 bool short_connection,
332 const brpc::Authenticator* auth = NULL,
333 std::string connection_group = std::string(),
334 bool use_backup_request_policy = false,
335 brpc::ProtocolType protocol = brpc::PROTOCOL_BAIDU_STD) {
336 brpc::ChannelOptions opt;
337 opt.protocol = protocol;
338 if (short_connection) {
339 opt.connection_type = brpc::CONNECTION_TYPE_SHORT;
340 }
341 opt.auth = auth;
342 opt.max_retry = 0;
343 opt.connection_group = connection_group;
344 if (use_backup_request_policy) {
345 opt.backup_request_policy = &_backup_request_policy;
346 }
347 if (single_server) {
348 EXPECT_EQ(0, channel->Init(_ep, &opt));
349 } else {
350 EXPECT_EQ(0, channel->Init(_naming_url.c_str(), "rR", &opt));
351 }
352 }
353
354 void CallMethod(brpc::ChannelBase* channel,
355 brpc::Controller* cntl,

Callers

nothing calls this directly

Calls 2

InitMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected