From 8f5f33d56a59e761567c1194d80d4a623c7540ad Mon Sep 17 00:00:00 2001 From: legoc Date: Thu, 5 Jul 2018 13:21:28 +0200 Subject: [PATCH] Modified test timeout --- src/TestTimeoutApplication.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/TestTimeoutApplication.cpp b/src/TestTimeoutApplication.cpp index ac5d742..3ecb811 100644 --- a/src/TestTimeoutApplication.cpp +++ b/src/TestTimeoutApplication.cpp @@ -29,14 +29,28 @@ int main(int argc, char *argv[]) { // The start function must be called into a block to ensure the destructor of Instance is called before This::terminate() { - Server server("tcp://localhost:9000"); + Server server("tcp://localhost:10000"); + + while (true) { + + if (server.isAvailable(1)) { + cout << "server is available" << endl; + } + else { + cout << "server is not available" << endl; + } + + if (server.isAvailable(1000)) { + cout << "server is available" << endl; + } + else { + cout << "server is not available" << endl; + } - while (server.isAvailable(1000)) { - cout << "server is available" << endl; boost::this_thread::sleep(boost::posix_time::seconds(1)); } - cout << "server is not available" << endl; + } return 0; -- GitLab