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

Method CancelBeforeCallMethod

test/brpc_channel_unittest.cpp:940–960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

938
939
940 void CancelBeforeCallMethod(
941 bool single_server, bool async, bool short_connection) {
942 std::cout << " *** single=" << single_server
943 << " async=" << async
944 << " short=" << short_connection << std::endl;
945
946 ASSERT_EQ(0, StartAccept(_ep));
947 brpc::Channel channel;
948 SetUpChannel(&channel, single_server, short_connection);
949
950 brpc::Controller cntl;
951 test::EchoRequest req;
952 test::EchoResponse res;
953 req.set_message(__FUNCTION__);
954 const brpc::CallId cid = cntl.call_id();
955 ASSERT_TRUE(cid.value != 0);
956 brpc::StartCancel(cid);
957 CallMethod(&channel, &cntl, &req, &res, async);
958 EXPECT_EQ(ECANCELED, cntl.ErrorCode()) << cntl.ErrorText();
959 StopAndJoin();
960 }
961
962 void CancelBeforeCallMethodParallel(
963 bool single_server, bool async, bool short_connection) {

Callers

nothing calls this directly

Calls 4

StartCancelFunction · 0.85
call_idMethod · 0.80
ErrorCodeMethod · 0.80
ErrorTextMethod · 0.80

Tested by

no test coverage detected