summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/ClusterFixture.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-10-26 20:11:08 +0000
committerAlan Conway <aconway@apache.org>2009-10-26 20:11:08 +0000
commit2a9e3ffb12f3b621a2d8d3b4c84627cc0613b9cc (patch)
tree9c95f000293596c27b8f1058e50c46857b3c7cfc /qpid/cpp/src/tests/ClusterFixture.cpp
parent3bb44f765c64867196c00801f7299d490c41b5f4 (diff)
downloadqpid-python-2a9e3ffb12f3b621a2d8d3b4c84627cc0613b9cc.tar.gz
Separate FailoverListener from client::Connection.
client::ConnectionImpl used to contain a FailoverListener to subscribe for updates on the amq.failover exchange. This caused some lifecycle issues including memory leaks. Now FailoverListener is a public API class that the user must create associated with a session to get known-broker updates. Removed the weak_ptr logic in client::SessionImpl which was only required because of FailoverListener. Made SessionImpl::close() idempotent. Gets rid of spurious warning messages in some tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@829931 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClusterFixture.cpp')
-rw-r--r--qpid/cpp/src/tests/ClusterFixture.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/ClusterFixture.cpp b/qpid/cpp/src/tests/ClusterFixture.cpp
index 7c357c3cd1..fd90ed170e 100644
--- a/qpid/cpp/src/tests/ClusterFixture.cpp
+++ b/qpid/cpp/src/tests/ClusterFixture.cpp
@@ -141,13 +141,14 @@ void ClusterFixture::killWithSilencer(size_t n, client::Connection& c, int sig)
* Get the known broker ports from a Connection.
*@param n if specified wait for the cluster size to be n, up to a timeout.
*/
-std::set<int> knownBrokerPorts(qpid::client::Connection& source, int n) {
- std::vector<qpid::Url> urls = source.getKnownBrokers();
+std::set<int> knownBrokerPorts(qpid::client::Connection& c, int n) {
+ FailoverListener fl(c);
+ std::vector<qpid::Url> urls = fl.getKnownBrokers();
if (n >= 0 && unsigned(n) != urls.size()) {
// Retry up to 10 secs in .1 second intervals.
for (size_t retry=100; urls.size() != unsigned(n) && retry != 0; --retry) {
qpid::sys::usleep(1000*100); // 0.1 secs
- urls = source.getKnownBrokers();
+ urls = fl.getKnownBrokers();
}
}
std::set<int> s;