diff options
author | Marc Laukien <marc@zeroc.com> | 2003-08-28 20:33:29 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-08-28 20:33:29 +0000 |
commit | fae5803f20d2719a1e146828aa23b1bd9b9a9d04 (patch) | |
tree | 39b19d3cac3b15da6b7621867e2e7bf896cf3d62 /cpp/src | |
parent | Switched server implementation to use ties (diff) | |
download | ice-fae5803f20d2719a1e146828aa23b1bd9b9a9d04.tar.bz2 ice-fae5803f20d2719a1e146828aa23b1bd9b9a9d04.tar.xz ice-fae5803f20d2719a1e146828aa23b1bd9b9a9d04.zip |
connection closure timeout
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Connection.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp index 6cddb1b9d15..9fcfae99fa7 100644 --- a/cpp/src/Ice/Connection.cpp +++ b/cpp/src/Ice/Connection.cpp @@ -103,22 +103,28 @@ IceInternal::Connection::waitUntilFinished() { IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); - while(_transceiver || _dispatchCount > 0) + // + // We wait indefinitely until all outstanding requests are + // completed. Otherwise we couldn't guarantee that there are no + // outstanding calls when deactivate() is called on the servant + // locators. + // + while(_dispatchCount > 0) { - // - // We wait indefinitely until all outstanding requests are - // completed. If we were using a timeout here we couldn't - // guarantee that there are no outstanding calls when - // deactivate() is called on the servant locators. - // wait(); -/* + } + + // + // Now we must wait for connection closure. If there is a timeout, + // we force the connection closure. + // + while(_transceiver) + { if(_endpoint->timeout() >= 0) { if(!timedWait(IceUtil::Time::milliSeconds(_endpoint->timeout()))) { setState(StateClosed, CloseTimeoutException(__FILE__, __LINE__)); - assert(_dispatchCount == 0); // No return here, we must still wait until _transceiver becomes null. } } @@ -126,7 +132,6 @@ IceInternal::Connection::waitUntilFinished() { wait(); } -*/ } assert(_state == StateClosed); |