| 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) { |
nothing calls this directly
no test coverage detected