Commit 8f5f33d5 authored by legoc's avatar legoc

Modified test timeout

parent 454ccdf7
...@@ -29,14 +29,28 @@ int main(int argc, char *argv[]) { ...@@ -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() // 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)); boost::this_thread::sleep(boost::posix_time::seconds(1));
} }
cout << "server is not available" << endl;
} }
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment