| 1137 | } |
| 1138 | |
| 1139 | void CancelAfterCallMethod( |
| 1140 | bool single_server, bool async, bool short_connection) { |
| 1141 | std::cout << " *** single=" << single_server |
| 1142 | << " async=" << async |
| 1143 | << " short=" << short_connection << std::endl; |
| 1144 | |
| 1145 | ASSERT_EQ(0, StartAccept(_ep)); |
| 1146 | brpc::Channel channel; |
| 1147 | SetUpChannel(&channel, single_server, short_connection); |
| 1148 | |
| 1149 | brpc::Controller cntl; |
| 1150 | test::EchoRequest req; |
| 1151 | test::EchoResponse res; |
| 1152 | req.set_message(__FUNCTION__); |
| 1153 | const brpc::CallId cid = cntl.call_id(); |
| 1154 | ASSERT_TRUE(cid.value != 0); |
| 1155 | CallMethod(&channel, &cntl, &req, &res, async); |
| 1156 | EXPECT_EQ(0, cntl.ErrorCode()); |
| 1157 | EXPECT_EQ(0, cntl.sub_count()); |
| 1158 | ASSERT_EQ(EINVAL, bthread_id_error(cid, ECANCELED)); |
| 1159 | StopAndJoin(); |
| 1160 | } |
| 1161 | |
| 1162 | void CancelAfterCallMethodParallel( |
| 1163 | bool single_server, bool async, bool short_connection) { |