qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1133822 - in /qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10: ConnectionImpl.cpp ConnectionImpl.h SessionImpl.cpp
Date Thu, 09 Jun 2011 12:24:48 GMT
Author: gsim
Date: Thu Jun  9 12:24:48 2011
New Revision: 1133822

URL: http://svn.apache.org/viewvc?rev=1133822&view=rev
Log:
QPID-3292: Don't try to reconnect at all if reconnect option is false

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h
    qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp?rev=1133822&r1=1133821&r2=1133822&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.cpp Thu Jun  9 12:24:48 2011
@@ -198,7 +198,7 @@ qpid::messaging::Session ConnectionImpl:
             sessions[name] = impl;
             break;
         } catch (const qpid::TransportFailure&) {
-            open();
+            reopen();
         } catch (const qpid::SessionException& e) {
             throw qpid::messaging::SessionError(e.what());
         } catch (const std::exception& e) {
@@ -219,6 +219,15 @@ void ConnectionImpl::open()
     catch (const qpid::Exception& e) { throw messaging::ConnectionError(e.what()); }
 }
 
+void ConnectionImpl::reopen()
+{
+    if (!reconnect) {
+        throw qpid::messaging::TransportFailure("Failed to connect (reconnect disabled)");
+    }
+    open();
+}
+
+
 bool expired(const qpid::sys::AbsTime& start, int64_t timeout)
 {
     if (timeout == 0) return true;

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h?rev=1133822&r1=1133821&r2=1133822&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/ConnectionImpl.h Thu Jun  9 12:24:48 2011
@@ -43,6 +43,7 @@ class ConnectionImpl : public qpid::mess
   public:
     ConnectionImpl(const std::string& url, const qpid::types::Variant::Map& options);
     void open();
+    void reopen();
     bool isOpen() const;
     void close();
     qpid::messaging::Session newSession(bool transactional, const std::string& name);

Modified: qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp?rev=1133822&r1=1133821&r2=1133822&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/amqp0_10/SessionImpl.cpp Thu Jun  9 12:24:48 2011
@@ -509,7 +509,7 @@ void SessionImpl::senderCancelled(const 
 
 void SessionImpl::reconnect()
 {
-    connection->open();
+    connection->reopen();
 }
 
 bool SessionImpl::backoff()



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message