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

Method Echo

test/brpc_streaming_rpc_unittest.cpp:55–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 {}
54
55 void Echo(::google::protobuf::RpcController* controller,
56 const ::test::EchoRequest* request,
57 ::test::EchoResponse* response,
58 ::google::protobuf::Closure* done) {
59 brpc::ClosureGuard done_guard(done);
60 response->set_message(request->message());
61 brpc::Controller* cntl = (brpc::Controller*)controller;
62 brpc::StreamId response_stream;
63 ASSERT_EQ(0, StreamAccept(&response_stream, *cntl, &_options));
64 LOG(INFO) << "Created response_stream=" << response_stream;
65 if (_after_accept_stream) {
66 _after_accept_stream->action(response_stream);
67 }
68 }
69private:
70 brpc::StreamOptions _options;
71 AfterAcceptStream* _after_accept_stream;

Callers 1

TEST_FFunction · 0.45

Calls 3

StreamAcceptFunction · 0.85
actionMethod · 0.80
messageMethod · 0.45

Tested by

no test coverage detected