Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 52868 invoked from network); 7 Nov 2010 23:37:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Nov 2010 23:37:34 -0000 Received: (qmail 23338 invoked by uid 500); 7 Nov 2010 23:38:05 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 23312 invoked by uid 500); 7 Nov 2010 23:38:05 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 23302 invoked by uid 99); 7 Nov 2010 23:38:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 23:38:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 23:38:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 603372388994; Sun, 7 Nov 2010 23:36:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Sun, 07 Nov 2010 23:36:48 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101107233648.603372388994@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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; /// /// 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");