summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-12-01 05:11:38 +0000
committerAlan Conway <aconway@apache.org>2007-12-01 05:11:38 +0000
commit9a5521b5aaaf1f620c4210ecf09e180ed2934988 (patch)
tree9f71cab2186c5c3ccf4730efb1a3bf819f535a9b /cpp/src/qpid/client
parent1ef2d3ad182ca4ec136632c35f7ac173a1601eb5 (diff)
downloadqpid-python-9a5521b5aaaf1f620c4210ecf09e180ed2934988.tar.gz
Fix problem where client does notice disconnection from Broker.
src/qpid/client/SessionCore.cpp: close/open Demux on suspend/resume. src/tests/exception_test.cpp: convert to Session API, boost test. - Temporarily disabled due issues noted in TODO comments git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@600046 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
-rw-r--r--cpp/src/qpid/client/Demux.cpp9
-rw-r--r--cpp/src/qpid/client/Demux.h1
-rw-r--r--cpp/src/qpid/client/SessionCore.cpp9
3 files changed, 15 insertions, 4 deletions
diff --git a/cpp/src/qpid/client/Demux.cpp b/cpp/src/qpid/client/Demux.cpp
index bd1dda0ae9..e61103981b 100644
--- a/cpp/src/qpid/client/Demux.cpp
+++ b/cpp/src/qpid/client/Demux.cpp
@@ -74,6 +74,15 @@ void Demux::close()
defaultQueue->close();
}
+void Demux::open()
+{
+ sys::Mutex::ScopedLock l(lock);
+ for (iterator i = records.begin(); i != records.end(); i++) {
+ i->queue->open();
+ }
+ defaultQueue->open();
+}
+
Demux::QueuePtr Demux::add(const std::string& name, Condition condition)
{
sys::Mutex::ScopedLock l(lock);
diff --git a/cpp/src/qpid/client/Demux.h b/cpp/src/qpid/client/Demux.h
index 5aaf75db44..234282a8d2 100644
--- a/cpp/src/qpid/client/Demux.h
+++ b/cpp/src/qpid/client/Demux.h
@@ -51,6 +51,7 @@ public:
void handle(framing::FrameSet::shared_ptr);
void close();
+ void open();
QueuePtr add(const std::string& name, Condition);
void remove(const std::string& name);
diff --git a/cpp/src/qpid/client/SessionCore.cpp b/cpp/src/qpid/client/SessionCore.cpp
index 3f042bc13a..ee9e9570ed 100644
--- a/cpp/src/qpid/client/SessionCore.cpp
+++ b/cpp/src/qpid/client/SessionCore.cpp
@@ -125,26 +125,26 @@ void SessionCore::detach(int c, const std::string& t) {
channel.next = 0;
code=c;
text=t;
+ l3.getDemux().close();
}
void SessionCore::doClose(int code, const std::string& text) {
if (state != CLOSED) {
session.reset();
- l3.getDemux().close();
- l3.getCompletionTracker().close();
detach(code, text);
setState(CLOSED);
+ l3.getCompletionTracker().close();
}
invariant();
}
void SessionCore::doSuspend(int code, const std::string& text) {
- if (state != CLOSED) {
- invariant();
+ if (state != CLOSED && state != SUSPENDED) {
detach(code, text);
session->suspend();
setState(SUSPENDED);
}
+ invariant();
}
ExecutionHandler& SessionCore::getExecution() { // user thread
@@ -221,6 +221,7 @@ void SessionCore::resume(shared_ptr<ConnectionImpl> c) {
channel.handle(*i); // Direct to channel.
check();
}
+ l3.getDemux().open();
}
}