| 2071 | } |
| 2072 | |
| 2073 | void TestClientHost(const butil::EndPoint& ep, |
| 2074 | brpc::Controller& cntl, |
| 2075 | int error_code, bool failed, |
| 2076 | brpc::ChannelOptions& copt) { |
| 2077 | brpc::Channel chan; |
| 2078 | copt.max_retry = 0; |
| 2079 | ASSERT_EQ(0, chan.Init(ep, &copt)); |
| 2080 | |
| 2081 | test::EchoRequest req; |
| 2082 | test::EchoResponse res; |
| 2083 | req.set_message(EXP_REQUEST); |
| 2084 | test::EchoService_Stub stub(&chan); |
| 2085 | stub.Echo(&cntl, &req, &res, NULL); |
| 2086 | ASSERT_EQ(cntl.Failed(), failed) << cntl.ErrorText(); |
| 2087 | ASSERT_EQ(cntl.ErrorCode(), error_code); |
| 2088 | } |
| 2089 | |
| 2090 | TEST_F(ServerTest, bind_client_host_and_network_device) { |
| 2091 | butil::EndPoint ep; |