summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Connection.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-11-05 17:09:33 +0000
committerAlan Conway <aconway@apache.org>2008-11-05 17:09:33 +0000
commit8ad76093e682ee735314a6768709b77a09d152ec (patch)
tree820c8d0055018b1b675fb018d8516da3363e716a /cpp/src/qpid/cluster/Connection.cpp
parent7f272c99e485eaa8eb38ac9b28d82637aeb4dbbc (diff)
downloadqpid-python-8ad76093e682ee735314a6768709b77a09d152ec.tar.gz
Cluster: clean up connections when a member leaves the cluster.
Fixed a memory error in cluster_test and some reporting errors in test scripts. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711623 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Connection.cpp')
-rw-r--r--cpp/src/qpid/cluster/Connection.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/Connection.cpp b/cpp/src/qpid/cluster/Connection.cpp
index 513816735d..bcdc4ffe27 100644
--- a/cpp/src/qpid/cluster/Connection.cpp
+++ b/cpp/src/qpid/cluster/Connection.cpp
@@ -141,6 +141,7 @@ void Connection::delivered(framing::AMQFrame& f) {
}
}
+// A local connection is closed by the network layer.
void Connection::closed() {
try {
if (catchUp) {
@@ -165,12 +166,19 @@ void Connection::closed() {
}
}
+// Self-delivery of close message, close the connection.
void Connection::deliverClose () {
assert(!catchUp);
connection.closed();
cluster.erase(self);
}
+// Member of a shadow connection left the cluster.
+void Connection::left() {
+ assert(isShadow());
+ connection.closed();
+}
+
// Decode data from local clients.
size_t Connection::decode(const char* buffer, size_t size) {
if (catchUp) { // Handle catch-up locally.