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

Method Init

example/rdma_performance/client.cpp:103–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 inline bool IsStop() { return _stop; }
102
103 int Init() {
104 brpc::ChannelOptions options;
105 options.socket_mode = FLAGS_use_rdma? brpc::SOCKET_MODE_RDMA : brpc::SOCKET_MODE_TCP;
106 options.protocol = FLAGS_protocol;
107 options.connection_type = FLAGS_connection_type;
108 options.timeout_ms = FLAGS_rpc_timeout_ms;
109 options.max_retry = 0;
110 std::string server = g_servers[(rr_index++) % g_servers.size()];
111 _channel = new brpc::Channel();
112 if (_channel->Init(server.c_str(), &options) != 0) {
113 LOG(ERROR) << "Fail to initialize channel";
114 return -1;
115 }
116 brpc::Controller cntl;
117 test::PerfTestResponse response;
118 test::PerfTestRequest request;
119 request.set_echo_attachment(_echo_attachment);
120 test::PerfTestService_Stub stub(_channel);
121 stub.Test(&cntl, &request, &response, NULL);
122 if (cntl.Failed()) {
123 LOG(ERROR) << "RPC call failed: " << cntl.ErrorText();
124 return -1;
125 }
126 return 0;
127 }
128
129 struct RespClosure {
130 brpc::Controller* cntl;

Callers 15

mainFunction · 0.45
TestFunction · 0.45
mainFunction · 0.45
EchoServiceImplMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 5

ErrorTextMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
TestMethod · 0.45
FailedMethod · 0.45

Tested by 1

TestFunction · 0.36