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

Method Echo

test/brpc_ssl_unittest.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 EchoServiceImpl() : count(0) {}
60 ~EchoServiceImpl() override { g_delete = true; }
61 void Echo(google::protobuf::RpcController* cntl_base,
62 const test::EchoRequest* request,
63 test::EchoResponse* response,
64 google::protobuf::Closure* done) override {
65 brpc::ClosureGuard done_guard(done);
66 brpc::Controller* cntl = (brpc::Controller*)cntl_base;
67 count.fetch_add(1, butil::memory_order_relaxed);
68 EXPECT_EQ(EXP_REQUEST, request->message());
69 EXPECT_TRUE(cntl->is_ssl());
70
71 response->set_message(EXP_RESPONSE);
72 if (request->sleep_us() > 0) {
73 LOG(INFO) << "Sleep " << request->sleep_us() << " us, protocol="
74 << cntl->request_protocol();
75 bthread_usleep(request->sleep_us());
76 }
77 }
78
79 butil::atomic<int64_t> count;
80};

Callers 2

SendMultipleRPCFunction · 0.45
TEST_FFunction · 0.45

Calls 5

bthread_usleepFunction · 0.85
fetch_addMethod · 0.80
is_sslMethod · 0.80
request_protocolMethod · 0.80
messageMethod · 0.45

Tested by

no test coverage detected