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

Method Echo

test/brpc_http_rpc_protocol_unittest.cpp:110–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108class MyEchoService : public ::test::EchoService {
109public:
110 void Echo(::google::protobuf::RpcController* cntl_base,
111 const ::test::EchoRequest* req,
112 ::test::EchoResponse* res,
113 ::google::protobuf::Closure* done) {
114 brpc::ClosureGuard done_guard(done);
115 brpc::Controller* cntl =
116 static_cast<brpc::Controller*>(cntl_base);
117 const std::string* sleep_ms_str =
118 cntl->http_request().uri().GetQuery("sleep_ms");
119 if (sleep_ms_str) {
120 bthread_usleep(strtol(sleep_ms_str->data(), NULL, 10) * 1000);
121 }
122 res->set_message(EXP_RESPONSE);
123 }
124};
125
126class HttpTest : public ::testing::Test{

Callers 1

TEST_FFunction · 0.45

Calls 3

bthread_usleepFunction · 0.85
GetQueryMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected