summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/Dispatcher.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-11-30 14:37:45 +0000
committerGordon Sim <gsim@apache.org>2007-11-30 14:37:45 +0000
commit3a8b72846031b6bef2b8e05f14c277769e39891b (patch)
tree390fd1e0f2d689b8efd2a95846df0443403e285a /cpp/src/qpid/client/Dispatcher.cpp
parent682ed251693e5fefbe0552702215c4bc01d0d93f (diff)
downloadqpid-python-3a8b72846031b6bef2b8e05f14c277769e39891b.tar.gz
Altered topic test to use the new session api.
Exposed start() through the subscription manager in addition to run(). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@599832 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/Dispatcher.cpp')
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 37fada45fb..7ffcd676a3 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -69,18 +69,22 @@ void Dispatcher::run()
boost::state_saver<bool> reset(running); // Reset to false on exit.
running = true;
queue->open();
- while (!queue->isClosed()) {
- Mutex::ScopedUnlock u(lock);
- FrameSet::shared_ptr content = queue->pop();
- if (content->isA<MessageTransferBody>()) {
- Message msg(*content, session);
- Subscriber::shared_ptr listener = find(msg.getDestination());
- assert(listener);
- listener->received(msg);
- } else {
- assert (handler.get());
- handler->handle(*content);
+ try {
+ while (!queue->isClosed()) {
+ Mutex::ScopedUnlock u(lock);
+ FrameSet::shared_ptr content = queue->pop();
+ if (content->isA<MessageTransferBody>()) {
+ Message msg(*content, session);
+ Subscriber::shared_ptr listener = find(msg.getDestination());
+ assert(listener);
+ listener->received(msg);
+ } else {
+ assert (handler.get());
+ handler->handle(*content);
+ }
}
+ } catch (const ClosedException&) {
+ //ignore it and return
}
}