summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/timeout/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/timeout/AllTests.cpp')
-rw-r--r--cpp/test/Ice/timeout/AllTests.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/cpp/test/Ice/timeout/AllTests.cpp b/cpp/test/Ice/timeout/AllTests.cpp
index c5be82c13d1..f3866356dac 100644
--- a/cpp/test/Ice/timeout/AllTests.cpp
+++ b/cpp/test/Ice/timeout/AllTests.cpp
@@ -209,6 +209,50 @@ allTests(const Ice::CommunicatorPtr& communicator)
to->begin_sleep(250, newCallback_Timeout_sleep(cb, &Callback::response, &Callback::exception));
cb->check();
}
+ {
+ //
+ // Backward compatible connection timeouts
+ //
+ TimeoutPrx to = TimeoutPrx::uncheckedCast(obj->ice_invocationTimeout(-2)->ice_timeout(250));
+ Ice::ConnectionPtr con;
+ try
+ {
+ con = to->ice_getConnection();
+ to->sleep(500);
+ test(false);
+ }
+ catch(const Ice::TimeoutException&)
+ {
+ try
+ {
+ con->getInfo();
+ test(false);
+ }
+ catch(const Ice::TimeoutException&)
+ {
+ // Connection got closed as well.
+ }
+ }
+
+ try
+ {
+ con = to->ice_getConnection();
+ to->end_sleep(to->begin_sleep(500));
+ test(false);
+ }
+ catch(const Ice::TimeoutException&)
+ {
+ try
+ {
+ con->getInfo();
+ test(false);
+ }
+ catch(const Ice::TimeoutException&)
+ {
+ // Connection got closed as well.
+ }
+ }
+ }
cout << "ok" << endl;
cout << "testing close timeout... " << flush;