activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r771411 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core: ActiveMQConnection.cpp ActiveMQConnection.h
Date Mon, 04 May 2009 19:25:08 GMT
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;



Mime
View raw message