summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/Connection.cpp')
-rw-r--r--cpp/src/Ice/Connection.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index c26a7258c03..4f88a116b28 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -105,10 +105,17 @@ IceInternal::Connection::waitUntilFinished()
while(_transceiver || _dispatchCount > 0)
{
- if(timedWait(IceUtil::Time::milliSeconds(_endpoint->timeout())))
+ if(_endpoint->timeout() >= 0)
{
- setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
- // No return here, we must still wait until _transceiver becomes null.
+ if(!timedWait(IceUtil::Time::milliSeconds(_endpoint->timeout())))
+ {
+ setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__));
+ // No return here, we must still wait until _transceiver becomes null.
+ }
+ }
+ else
+ {
+ wait();
}
}