diff options
Diffstat (limited to 'cpp/src/qpid/client')
| -rw-r--r-- | cpp/src/qpid/client/Demux.cpp | 9 | ||||
| -rw-r--r-- | cpp/src/qpid/client/Demux.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/client/SessionCore.cpp | 9 |
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(); } } |
