diff options
author | Marc Laukien <marc@zeroc.com> | 2005-10-19 19:38:29 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2005-10-19 19:38:29 +0000 |
commit | 19b0063c628a7f0118f2af0b98ef35ca458b83d3 (patch) | |
tree | 3e6166fa34629c9234ec53f877505be768238c16 /cppe/src | |
parent | fixed Connection::close(false) (diff) | |
download | ice-19b0063c628a7f0118f2af0b98ef35ca458b83d3.tar.bz2 ice-19b0063c628a7f0118f2af0b98ef35ca458b83d3.tar.xz ice-19b0063c628a7f0118f2af0b98ef35ca458b83d3.zip |
fixed Connection::close(false)
Diffstat (limited to 'cppe/src')
-rwxr-xr-x | cppe/src/IceE/Connection.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp index 006406e0115..afe4a5210dd 100755 --- a/cppe/src/IceE/Connection.cpp +++ b/cppe/src/IceE/Connection.cpp @@ -119,6 +119,26 @@ Ice::Connection::close(bool force) } else { + // + // If we do a graceful shutdown, then we wait until all + // outstanding requests have been completed. Otherwise, the + // CloseConnectionException will cause all outstanding + // requests to be retried, regardless of whether the server + // has processed them or not. + // + // For consistency, we also wait until batch requests have + // completed, and, if this is a server connection, all + // requests have been dispatched. These are the same criteria + // that we use to determine whether ACM may close this + // connection. + // + while(!_requests.empty() || + _batchStreamInUse || !_batchStream.b.empty() || + _dispatchCount != 0) + { + wait(); + } + setState(StateClosing, CloseConnectionException(__FILE__, __LINE__)); } } |