| 960 | } |
| 961 | |
| 962 | void CancelBeforeCallMethodParallel( |
| 963 | bool single_server, bool async, bool short_connection) { |
| 964 | std::cout << " *** single=" << single_server |
| 965 | << " async=" << async |
| 966 | << " short=" << short_connection << std::endl; |
| 967 | |
| 968 | ASSERT_EQ(0, StartAccept(_ep)); |
| 969 | |
| 970 | const size_t NCHANS = 8; |
| 971 | brpc::Channel subchans[NCHANS]; |
| 972 | brpc::ParallelChannel channel; |
| 973 | for (size_t i = 0; i < NCHANS; ++i) { |
| 974 | SetUpChannel(&subchans[i], single_server, short_connection); |
| 975 | ASSERT_EQ(0, channel.AddChannel( |
| 976 | &subchans[i], brpc::DOESNT_OWN_CHANNEL, |
| 977 | NULL, NULL)); |
| 978 | } |
| 979 | |
| 980 | brpc::Controller cntl; |
| 981 | test::EchoRequest req; |
| 982 | test::EchoResponse res; |
| 983 | req.set_message(__FUNCTION__); |
| 984 | const brpc::CallId cid = cntl.call_id(); |
| 985 | ASSERT_TRUE(cid.value != 0); |
| 986 | brpc::StartCancel(cid); |
| 987 | CallMethod(&channel, &cntl, &req, &res, async); |
| 988 | EXPECT_EQ(ECANCELED, cntl.ErrorCode()) << cntl.ErrorText(); |
| 989 | EXPECT_EQ(NCHANS, (size_t)cntl.sub_count()); |
| 990 | EXPECT_TRUE(NULL == cntl.sub(1)); |
| 991 | EXPECT_TRUE(NULL == cntl.sub(0)); |
| 992 | StopAndJoin(); |
| 993 | } |
| 994 | |
| 995 | void CancelBeforeCallMethodSelective( |
| 996 | bool single_server, bool async, bool short_connection) { |
nothing calls this directly
no test coverage detected