You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2009/06/25 03:13:44 UTC

svn commit: r788234 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk: ./ deploy/ nant-common.xml src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs vs2008-activemq-test.csproj vs2008-activemq.csproj vs2008-activemq.sln

Author: jgomes
Date: Thu Jun 25 01:13:44 2009
New Revision: 788234

URL: http://svn.apache.org/viewvc?rev=788234&view=rev
Log:
Applied patch to set worker thread as background thread.  Thanks to Iddo Shoham for the fix!
Fixes [AMQNET-166]. (See https://issues.apache.org/activemq/browse/AMQNET-166)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/deploy/   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/nant-common.xml   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq-test.csproj   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.csproj   (props changed)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.sln   (props changed)

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1,2 +1,2 @@
 /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.0.0:692591,693525
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0:788230,788233

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/deploy/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1 +1 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/deploy:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/deploy:788230,788233

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/nant-common.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1 +1 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/nant-common.xml:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/nant-common.xml:788230,788233

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs?rev=788234&r1=788233&r2=788234&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/Multicast/MulticastDiscoveryAgent.cs Thu Jun 25 01:13:44 2009
@@ -32,7 +32,7 @@
 		public const int MAX_SOCKET_CONNECTION_RETRY_ATTEMPS = 3;
 		public const int DEFAULT_BACKOFF_MILLISECONDS = 100;
 		public const int BACKOFF_MULTIPLIER = 2;
-        public const string DEFAULT_DISCOVERY_URI_STRING = "multicast://239.255.2.3:6155";
+		public const string DEFAULT_DISCOVERY_URI_STRING = "multicast://239.255.2.3:6155";
 		private const string TYPE_SUFFIX = "ActiveMQ-4.";
 		private const string ALIVE = "alive";
 		private const string DEAD = "dead";
@@ -69,10 +69,10 @@
 		{
 			lock(stopstartSemaphore)
 			{
-                if (discoveryUri == null)
-                {
-                    discoveryUri = new Uri(DEFAULT_DISCOVERY_URI_STRING);
-                }
+				if (discoveryUri == null)
+				{
+					discoveryUri = new Uri(DEFAULT_DISCOVERY_URI_STRING);
+				}
 
 				if(multicastSocket == null)
 				{
@@ -98,6 +98,7 @@
 				{
 					Tracer.Info("Starting multicast discovery agent worker thread");
 					worker = new Thread(new ThreadStart(worker_DoWork));
+					worker.IsBackground = true;
 					worker.Start();
 					isStarted = true;
 				}
@@ -182,15 +183,15 @@
 					int numBytes = multicastSocket.Receive(buffer);
 					receivedInfoRaw = System.Text.Encoding.UTF8.GetString(buffer, 0, numBytes);
 					// We have to remove all of the null bytes if there are any otherwise we just
-                    // take the whole string as is.
-                    if (receivedInfoRaw.IndexOf("\0") != -1)
-                    {
-                        receivedInfo = receivedInfoRaw.Substring(0, receivedInfoRaw.IndexOf("\0"));
-                    }
-                    else
-                    {
-                        receivedInfo = receivedInfoRaw;
-                    }
+					// take the whole string as is.
+					if (receivedInfoRaw.IndexOf("\0") != -1)
+					{
+						receivedInfo = receivedInfoRaw.Substring(0, receivedInfoRaw.IndexOf("\0"));
+					}
+					else
+					{
+						receivedInfo = receivedInfoRaw;
+					}
 
 					ProcessBrokerMessage(receivedInfo);
 				}
@@ -294,16 +295,16 @@
 			}
 		}
 
-        #region Properties
+		#region Properties
 
-        /// <summary>
-        /// This property indicates whether or not async send is enabled.
-        /// </summary>
-        public Uri DiscoveryURI
-        {
-            get { return discoveryUri; }
-            set { discoveryUri = value; }
-        }
+		/// <summary>
+		/// This property indicates whether or not async send is enabled.
+		/// </summary>
+		public Uri DiscoveryURI
+		{
+			get { return discoveryUri; }
+			set { discoveryUri = value; }
+		}
 
 		public bool IsStarted
 		{
@@ -314,11 +315,11 @@
 		{
 			get { return group; }
 			set { group = value; }
-        }
+		}
 
-        #endregion
+		#endregion
 
-        internal string MulticastType
+		internal string MulticastType
 		{
 			get { return group + "." + TYPE_SUFFIX; }
 		}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq-test.csproj
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1 +1 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq-test.csproj:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq-test.csproj:788230,788233

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.csproj
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1 +1 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.csproj:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.csproj:788230,788233

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/vs2008-activemq.sln
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jun 25 01:13:44 2009
@@ -1 +1 @@
-/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.sln:788230
+/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/tags/1.1.0/vs2008-activemq.sln:788230,788233