From ff5c8a9034026a6d3ae437fa89c9f3cb9a1ba022 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 3 Oct 2008 20:56:38 +0000 Subject: Cluster join & brain-dumps working. cluster: improved join protocol, fixed race conditions. client/ConnectionHandler,ConnectionImpl: fixed connection close race causing client hang. src/qpid/sys/PollableQueue.h: fixed incorrect use of startWatch/stopWatch. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@701532 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/Event.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/cluster/Event.cpp') diff --git a/cpp/src/qpid/cluster/Event.cpp b/cpp/src/qpid/cluster/Event.cpp index 2531001504..f7389c1922 100644 --- a/cpp/src/qpid/cluster/Event.cpp +++ b/cpp/src/qpid/cluster/Event.cpp @@ -22,6 +22,7 @@ #include "Event.h" #include "Cpg.h" #include "qpid/framing/Buffer.h" +#include "qpid/framing/AMQFrame.h" #include #include #include @@ -46,12 +47,20 @@ Event Event::delivered(const MemberId& m, void* d, size_t s) { memcpy(e.getData(), static_cast(d)+OVERHEAD, s-OVERHEAD); return e; } + +Event Event::control(const framing::AMQBody& body, const ConnectionId& cid, uint32_t id) { + framing::AMQFrame f(body); + Event e(CONTROL, cid, f.size(), id); + Buffer buf(e); + f.encode(buf); + return e; +} void Event::mcast (const Cpg::Name& name, Cpg& cpg) const { char header[OVERHEAD]; Buffer b(header, OVERHEAD); b.putOctet(type); - b.putLongLong(reinterpret_cast(connectionId.getConnectionPtr())); + b.putLongLong(reinterpret_cast(connectionId.getPointer())); b.putLong(id); iovec iov[] = { { header, OVERHEAD }, { const_cast(getData()), getSize() } }; cpg.mcast(name, iov, sizeof(iov)/sizeof(*iov)); -- cgit v1.2.1