From 0637677cf6653256b67c82dcb74f35133601220c Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Sun, 20 Apr 2008 12:10:37 +0000 Subject: QPID-920: converted c++ client to use final 0-10 protocol * connection handler converted to using invoker & proxy and updated to final method defs * SessionCore & ExecutionHandler replace by SessionImpl * simplified handling of completion & results, removed handling of responses git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649915 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/ConnectionImpl.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp') diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp index b248de8744..d1fd66ff26 100644 --- a/cpp/src/qpid/client/ConnectionImpl.cpp +++ b/cpp/src/qpid/client/ConnectionImpl.cpp @@ -23,7 +23,7 @@ #include "qpid/framing/reply_exceptions.h" #include "ConnectionImpl.h" -#include "SessionCore.h" +#include "SessionImpl.h" #include #include @@ -32,6 +32,7 @@ using namespace qpid::client; using namespace qpid::framing; using namespace qpid::sys; + ConnectionImpl::ConnectionImpl(boost::shared_ptr c) : connector(c), isClosed(false), isClosing(false) { @@ -52,10 +53,10 @@ ConnectionImpl::~ConnectionImpl() { connector->close(); } -void ConnectionImpl::addSession(const boost::shared_ptr& session) +void ConnectionImpl::addSession(const boost::shared_ptr& session) { Mutex::ScopedLock l(lock); - boost::weak_ptr& s = sessions[session->getChannel()]; + boost::weak_ptr& s = sessions[session->getChannel()]; if (s.lock()) throw ChannelBusyException(); s = session; } @@ -67,7 +68,7 @@ void ConnectionImpl::handle(framing::AMQFrame& frame) void ConnectionImpl::incoming(framing::AMQFrame& frame) { - boost::shared_ptr s; + boost::shared_ptr s; { Mutex::ScopedLock l(lock); s = sessions[frame.getChannel()].lock(); @@ -122,7 +123,7 @@ ConnectionImpl::SessionVector ConnectionImpl::closeInternal(const Mutex::ScopedL connector->close(); SessionVector save; for (SessionMap::iterator i = sessions.begin(); i != sessions.end(); ++i) { - boost::shared_ptr s = i->second.lock(); + boost::shared_ptr s = i->second.lock(); if (s) save.push_back(s); } sessions.clear(); @@ -135,7 +136,7 @@ void ConnectionImpl::closed(uint16_t code, const std::string& text) if (isClosed) return; SessionVector save(closeInternal(l)); Mutex::ScopedUnlock u(lock); - std::for_each(save.begin(), save.end(), boost::bind(&SessionCore::connectionClosed, _1, code, text)); + std::for_each(save.begin(), save.end(), boost::bind(&SessionImpl::connectionClosed, _1, code, text)); } static const std::string CONN_CLOSED("Connection closed by broker"); @@ -148,7 +149,7 @@ void ConnectionImpl::shutdown() handler.fail(CONN_CLOSED); Mutex::ScopedUnlock u(lock); std::for_each(save.begin(), save.end(), - boost::bind(&SessionCore::connectionBroke, _1, INTERNAL_ERROR, CONN_CLOSED)); + boost::bind(&SessionImpl::connectionBroke, _1, INTERNAL_ERROR, CONN_CLOSED)); } void ConnectionImpl::erase(uint16_t ch) { -- cgit v1.2.1