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 2010/11/08 00:36:48 UTC

svn commit: r1032420 - in /activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp: Commands/ConnectionInfo.cs Connection.cs Protocol/StompFrame.cs Protocol/StompWireFormat.cs

Author: tabish
Date: Sun Nov  7 23:36:47 2010
New Revision: 1032420

URL: http://svn.apache.org/viewvc?rev=1032420&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-284

Allow incoming newlines that aren't part of a command to be treated as a KeepAliveInfo command.
Don't delay starting the inactivity monitor thread to send heartbeats.

Modified:
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Commands/ConnectionInfo.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompFrame.cs
    activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Commands/ConnectionInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Commands/ConnectionInfo.cs?rev=1032420&r1=1032419&r2=1032420&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Commands/ConnectionInfo.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Commands/ConnectionInfo.cs Sun Nov  7 23:36:47 2010
@@ -28,7 +28,7 @@ namespace Apache.NMS.Stomp.Commands
         string userName;
 
         long maxInactivityDuration = 30000;
-        long maxInactivityDurationInitialDelay = 10000;
+        long maxInactivityDurationInitialDelay = 0;
 
         /// <summery>
         /// Get the unique identifier that this object and its own
@@ -49,6 +49,8 @@ namespace Apache.NMS.Stomp.Commands
                 "ConnectionId=" + ConnectionId + ", " +
                 "Host=" + Host + ", " +
                 "MaxInactivityDuration=" + MaxInactivityDuration + ", " +
+                "ReadCheckInterval=" + ReadCheckInterval + ", " +
+                "WriteCheckInterval=" + WriteCheckInterval + ", " +
                 "MaxInactivityDurationInitialDelay=" + MaxInactivityDurationInitialDelay + ", " +
                 "ClientId=" + ClientId + ", " +
                 "Password=" + Password + ", " +

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs?rev=1032420&r1=1032419&r2=1032420&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Connection.cs Sun Nov  7 23:36:47 2010
@@ -572,6 +572,11 @@ namespace Apache.NMS.Stomp
             }
             else if(command.IsWireFormatInfo)
             {
+                // Ignore for now, might need to save if off later.
+            }
+            else if(command.IsKeepAliveInfo)
+            {
+                // Ignore only the InactivityMonitor cares about this one.
             }
             else if(command.IsErrorCommand)
             {

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompFrame.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompFrame.cs?rev=1032420&r1=1032419&r2=1032420&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompFrame.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompFrame.cs Sun Nov  7 23:36:47 2010
@@ -148,11 +148,12 @@ namespace Apache.NMS.Stomp.Protocol
 
         private void ReadCommandHeader(BinaryReader dataIn)
         {
-            do 
+            this.command = ReadLine(dataIn);
+
+            if(String.IsNullOrEmpty(this.command))
             {
-                this.command = ReadLine(dataIn);
+                this.command = "KEEPALIVE";
             }
-            while(this.command == "");            
         }
 
         private void ReadHeaders(BinaryReader dataIn)

Modified: activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs?rev=1032420&r1=1032419&r2=1032420&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.Stomp/trunk/src/main/csharp/Protocol/StompWireFormat.cs Sun Nov  7 23:36:47 2010
@@ -174,6 +174,11 @@ namespace Apache.NMS.Stomp.Protocol
                     return answer;
                 }
             }
+            else if(command == "KEEPALIVE")
+            {
+                Tracer.Debug("StompWireFormat - Received KEEPALIVE command");
+                return new KeepAliveInfo();
+            }
             else if(command == "MESSAGE")
             {
                 Tracer.Debug("StompWireFormat - Received MESSAGE command");