add wait_conn

This commit is contained in:
qicosmos
2019-03-27 10:00:16 +08:00
parent 17598a5940
commit 2eb0d4f7df
2 changed files with 20 additions and 3 deletions
+5 -2
View File
@@ -98,8 +98,11 @@ struct dummy {
void test_async_client() {
async_client client("127.0.0.1", 9000);
client.connect();
// std::string str1;
// std::cin >> str1;
bool r = client.wait_conn(1);
if (!r) {
std::cout << "connect timeout" << std::endl;
return;
}
client.set_error_callback([] (boost::system::error_code ec){
std::cout << ec.message() << std::endl;