You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/05/04 21:25:08 UTC

svn commit: r771411 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core: ActiveMQConnection.cpp ActiveMQConnection.h

Author: tabish
Date: Mon May  4 19:25:07 2009
New Revision: 771411

URL: http://svn.apache.org/viewvc?rev=771411&view=rev
Log:
Updates to resolve some shutdown issues with Stomp where the broker closes the socket pretty quickly after getting the disconnect command. 

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=771411&r1=771410&r2=771411&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp Mon May  4 19:25:07 2009
@@ -222,6 +222,10 @@
             return;
         }
 
+        // Indicates we are on the way out to squelch any exceptions getting
+        // passed on from the transport as it goes down.
+        this->closing.set( true );
+
         // Get the complete list of active sessions.
         std::vector<ActiveMQSession*> allSessions;
         synchronized( &activeSessions ) {
@@ -511,7 +515,7 @@
     try {
 
         // We're disconnected - the asynchronous error is expected.
-        if( this->isClosed() ){
+        if( this->isClosed() || this->closing.get() ) {
             return;
         }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h?rev=771411&r1=771410&r2=771411&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h Mon May  4 19:25:07 2009
@@ -97,6 +97,12 @@
         AtomicBoolean closed;
 
         /**
+         * Indicates that this connection has been closed, it is no longer
+         * usable after this becomes true
+         */
+        AtomicBoolean closing;
+
+        /**
          * Map of message dispatchers indexed by consumer id.
          */
         DispatcherMap dispatchers;