diff options
| author | Alan Conway <aconway@apache.org> | 2008-10-08 00:36:42 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-10-08 00:36:42 +0000 |
| commit | 1896a5d32c87555877edd1dafc1bd34e3fcf5683 (patch) | |
| tree | 1b241ae2e857fa44170748075b07d40a973b18b4 /cpp/src/qpid/client/SessionImpl.cpp | |
| parent | 9d199b74aee76859480a7ee92d95c6db42028b43 (diff) | |
| download | qpid-python-1896a5d32c87555877edd1dafc1bd34e3fcf5683.tar.gz | |
rubygen/framing.0-10/constants.rb: create functions for all 3 exception subclasses.
client: added session suspend/resume functions, resume not implemented yet.
ClientSessionTest: enabled compilation of suspend/resume tests with expected failures.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@702674 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/SessionImpl.cpp')
| -rw-r--r-- | cpp/src/qpid/client/SessionImpl.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index 3e1ea8b724..5c61248b5a 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -105,7 +105,7 @@ void SessionImpl::open(uint32_t timeout) // user thread waitFor(ATTACHED); //TODO: timeout will not be set locally until get response to //confirm, should we wait for that? - proxy.requestTimeout(timeout); + setTimeout(timeout); proxy.commandPoint(nextOut, 0); } else { throw Exception("Open already called for this session"); @@ -115,11 +115,7 @@ void SessionImpl::open(uint32_t timeout) // user thread void SessionImpl::close() //user thread { Lock l(state); - if (detachedLifetime) { - proxy.requestTimeout(0); - //should we wait for the timeout response? - detachedLifetime = 0; - } + if (detachedLifetime) setTimeout(0); detach(); waitFor(DETACHED); } @@ -613,11 +609,8 @@ void SessionImpl::exception(uint16_t errorCode, error = EXCEPTION; code = errorCode; text = description; - if (detachedLifetime) { - proxy.requestTimeout(0); - //should we wait for the timeout response? - detachedLifetime = 0; - } + if (detachedLifetime) + setTimeout(0); } @@ -639,10 +632,10 @@ inline void SessionImpl::waitFor(State s) //call with lock held void SessionImpl::check() const //call with lock held. { switch (error) { - case OK: break; - case CONNECTION_CLOSE: throw ConnectionException(code, text); - case SESSION_DETACH: throw ChannelException(code, text); - case EXCEPTION: throwExecutionException(code, text); + case OK: break; + case CONNECTION_CLOSE: throw ConnectionException(code, text); + case SESSION_DETACH: throw ChannelException(code, text); + case EXCEPTION: createSessionException(code, text).raise(); } } @@ -668,4 +661,11 @@ void SessionImpl::handleClosed() results.close(); } +uint32_t SessionImpl::setTimeout(uint32_t seconds) { + proxy.requestTimeout(seconds); + // FIXME aconway 2008-10-07: wait for timeout response from broker + // and use value retured by broker. + detachedLifetime = seconds; + return detachedLifetime; +} }} |
