From a95eb74d7f806e3a60bbd61a042329bcfba9b21d Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 3 Nov 2008 17:21:38 +0000 Subject: Various fixes arising from testing client failover: * introduced new exception type for signalling connection failure (as distinct from any logical connection errors) * ConnectionImpl::closeInternal(): take copy of session map to prevent concurrent modification (by the same thread) as sessions are deleted and erase themselves. * ConnectionImpl::shutdown: hold lock before calling closeInternal(); mark handler failed before informing sessions of failure * SessionImpl::connectionBroker(): remove code as its rather meaningless * Don't swallow exceptions in Dispatcher * Handle exceptions in FailoverListener * Take weak_ptr to ConnectionImpl on constructor of Connector, then convert to shared_ptr when 'receiver' thread is started. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@710106 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/SessionImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/client/SessionImpl.cpp') diff --git a/cpp/src/qpid/client/SessionImpl.cpp b/cpp/src/qpid/client/SessionImpl.cpp index 08e405565a..0f86f7ff0a 100644 --- a/cpp/src/qpid/client/SessionImpl.cpp +++ b/cpp/src/qpid/client/SessionImpl.cpp @@ -260,8 +260,9 @@ void SessionImpl::connectionClosed(uint16_t code, const std::string& text) { * Called by ConnectionImpl to notify active sessions when connection * is disconnected */ -void SessionImpl::connectionBroke(uint16_t _code, const std::string& _text) { - connectionClosed(_code, _text); +void SessionImpl::connectionBroke(const std::string& _text) { + setException(sys::ExceptionHolder(new TransportFailure(_text))); + handleClosed(); } Future SessionImpl::send(const AMQBody& command) -- cgit v1.2.1