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

Function HandleEchoResponse

example/asynchronous_echo_c++/client.cpp:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32DEFINE_int32(max_retry, 3, "Max retries(not including the first RPC)");
33
34void HandleEchoResponse(
35 brpc::Controller* cntl,
36 example::EchoResponse* response) {
37 // std::unique_ptr makes sure cntl/response will be deleted before returning.
38 std::unique_ptr<brpc::Controller> cntl_guard(cntl);
39 std::unique_ptr<example::EchoResponse> response_guard(response);
40
41 if (cntl->Failed()) {
42 LOG(WARNING) << "Fail to send EchoRequest, " << cntl->ErrorText();
43 return;
44 }
45 LOG(INFO) << "Received response from " << cntl->remote_side()
46 << ": " << response->message() << " (attached="
47 << cntl->response_attachment() << ")"
48 << " latency=" << cntl->latency_us() << "us";
49}
50
51
52int main(int argc, char* argv[]) {

Callers

nothing calls this directly

Calls 5

ErrorTextMethod · 0.80
latency_usMethod · 0.80
FailedMethod · 0.45
remote_sideMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected