activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1057180 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport: InactivityMonitor.cs TransportFilter.cs
Date Mon, 10 Jan 2011 13:09:42 GMT
Author: tabish
Date: Mon Jan 10 13:09:42 2011
New Revision: 1057180

URL: http://svn.apache.org/viewvc?rev=1057180&view=rev
Log:
Apply similar fix as needed for AMQNET-298

Modified:
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/InactivityMonitor.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/TransportFilter.cs

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/InactivityMonitor.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/InactivityMonitor.cs?rev=1057180&r1=1057179&r2=1057180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/InactivityMonitor.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/InactivityMonitor.cs
Mon Jan 10 13:09:42 2011
@@ -45,6 +45,7 @@ namespace Apache.NMS.Stomp.Transport
         private AsyncWriteTask asyncWriteTask;
 
         private readonly Mutex monitor = new Mutex();
+        private bool disposing = false;
 
         private Timer connectionCheckTimer;
 
@@ -97,8 +98,8 @@ namespace Apache.NMS.Stomp.Transport
                 // get rid of unmanaged stuff
             }
 
+            this.disposing = true;
             StopMonitorThreads();
-
             base.Dispose(disposing);
         }
 
@@ -265,7 +266,7 @@ namespace Apache.NMS.Stomp.Transport
 
         protected override void OnException(ITransport sender, Exception command)
         {
-            if(failed.CompareAndSet(false, true))
+            if(failed.CompareAndSet(false, true) && !this.disposing)
             {
                 Tracer.Debug("Exception received in the Inactivity Monitor: " + command.ToString());
                 StopMonitorThreads();
@@ -277,6 +278,11 @@ namespace Apache.NMS.Stomp.Transport
         {
             lock(monitor)
             {
+                if(this.IsDisposed || this.disposing)
+                {
+                    return;
+                }
+                
                 if(monitorStarted.Value)
                 {
                     return;

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/TransportFilter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/TransportFilter.cs?rev=1057180&r1=1057179&r2=1057180&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/TransportFilter.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Transport/TransportFilter.cs
Mon Jan 10 13:09:42 2011
@@ -151,6 +151,8 @@ namespace Apache.NMS.Stomp.Transport
 		{
 			if(disposing)
 			{
+                Tracer.Debug("TransportFilter disposing of next Transport: " +
+                             this.next.GetType().Name);
 				this.next.Dispose();
 			}
 			disposed = true;
@@ -190,6 +192,7 @@ namespace Apache.NMS.Stomp.Transport
 		
 		public virtual void Stop()
 		{
+            this.next.Stop();
 		}
 
         public Object Narrow(Type type)



Mime
View raw message