activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1444451 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp
Date Sat, 09 Feb 2013 22:01:30 GMT
Author: tabish
Date: Sat Feb  9 22:01:30 2013
New Revision: 1444451

URL: http://svn.apache.org/r1444451
Log:
https://issues.apache.org/jira/browse/AMQCPP-457

Better control over Transport start and stop.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp?rev=1444451&r1=1444450&r2=1444451&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/TransportFilter.cpp
Sat Feb  9 22:01:30 2013
@@ -228,17 +228,23 @@ void TransportFilter::close() {
 
     try {
 
-        if (this->impl->closed.compareAndSet(false, true)) {
+        IOException error;
+        bool hasException = false;
+
+        try {
+            stop();
+        } catch (IOException& ex) {
+            error = ex;
+            error.setMark(__FILE__, __LINE__);
+            hasException = true;
+        }
 
-            this->impl->started.set(false);
+        if (this->impl->closed.compareAndSet(false, true)) {
 
             if (this->next == NULL) {
                 throw decaf::io::IOException(__FILE__, __LINE__, "Transport chain is invalid");
             }
 
-            IOException error;
-            bool hasException = false;
-
             next->setTransportListener(NULL);
 
             try {
@@ -256,10 +262,10 @@ void TransportFilter::close() {
                 error.setMark(__FILE__, __LINE__);
                 hasException = true;
             }
+        }
 
-            if (hasException) {
-                throw error;
-            }
+        if (hasException) {
+            throw error;
         }
     }
     AMQ_CATCH_RETHROW(IOException)



Mime
View raw message