diff options
author | Alan Conway <aconway@apache.org> | 2008-10-10 04:49:48 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-10-10 04:49:48 +0000 |
commit | 5d07d177cfc5eca21c44981bbe342f0cdcced4e5 (patch) | |
tree | 0f5f83642ed5effed52a5e2547565362ce2aea8c /cpp/src/qpid/client/ConnectionImpl.cpp | |
parent | e7ceead683231ef2cb35a6ee70488e859f023d12 (diff) | |
download | qpid-python-5d07d177cfc5eca21c44981bbe342f0cdcced4e5.tar.gz |
QPID-1340 froM Mick Goulish: preliminary client-side failover support.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703319 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r-- | cpp/src/qpid/client/ConnectionImpl.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index 910c908ee2..93eea50e43 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -151,13 +151,20 @@ static const std::string CONN_CLOSED("Connection closed by broker"); void ConnectionImpl::shutdown() { Mutex::ScopedLock l(lock); - if (handler.isClosed()) return; + if (handler.isClosed()) + { + std::cerr << "MDEBUG ConnectionImpl::shutdown -- returning w/o failure callback!\n"; + return; + } // FIXME aconway 2008-06-06: exception use, amqp0-10 does not seem to have // an appropriate close-code. connection-forced is not right. if (!handler.isClosing()) closeInternal(boost::bind(&SessionImpl::connectionBroke, _1, CLOSE_CODE_CONNECTION_FORCED, CONN_CLOSED)); setException(new ConnectionException(CLOSE_CODE_CONNECTION_FORCED, CONN_CLOSED)); handler.fail(CONN_CLOSED); + + if ( failureCallback ) + failureCallback(); } void ConnectionImpl::erase(uint16_t ch) { @@ -171,8 +178,8 @@ const ConnectionSettings& ConnectionImpl::getNegotiatedSettings() } std::vector<qpid::Url> ConnectionImpl::getKnownBrokers() { - // FIXME aconway 2008-10-08: initialize failover list from openOk or settings - return failover ? failover->getKnownBrokers() : std::vector<qpid::Url>(); + // FIXME aconway 2008-10-08: ensure we never return empty list, always include self Url. + return failover ? failover->getKnownBrokers() : handler.knownBrokersUrls; } boost::shared_ptr<SessionImpl> ConnectionImpl::newSession(const std::string& name, uint32_t timeout, uint16_t channel) { |