This commit is contained in:
qicosmos
2019-08-27 16:24:10 +08:00
parent ec5f90130d
commit c1f9888db7
+5 -2
View File
@@ -407,8 +407,11 @@ void test_sub1() {
std::thread thd1([&client, &stop] {
while (true) {
try {
int r = client.call<int>("add", 2, 3);
std::cout << "add result: " << r << "\n";
if (client.has_connected()) {
int r = client.call<int>("add", 2, 3);
std::cout << "add result: " << r << "\n";
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
catch (const std::exception& ex) {