https://issues.apache.org/activemq/browse/AMQNET-284

Sets the Host field on the v1.1+ Connect Frame.
Tweaks the Frame's keep alive send a bit more.
Updates the Inactivity monitor to better log its state and to no send the keep alive through its own Oneway method which was causing it to miss every other KeepAliveInfo send.  Also sets the Inactivity read check to use a generous window since Apollo seems to take twice as long as you ask it to send you a KeepAlive.
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs
index 0c2fa25..6ce7003 100755
--- a/src/main/csharp/Connection.cs
+++ b/src/main/csharp/Connection.cs
@@ -81,6 +81,7 @@
 
             this.info = new ConnectionInfo();
             this.info.ConnectionId = id;
+            this.info.Host = brokerUri.Host;
 
             this.messageTransformation = new StompMessageTransformation(this);
         }
diff --git a/src/main/csharp/Protocol/StompFrame.cs b/src/main/csharp/Protocol/StompFrame.cs
index e14c401..4fe3a3f 100644
--- a/src/main/csharp/Protocol/StompFrame.cs
+++ b/src/main/csharp/Protocol/StompFrame.cs
@@ -139,6 +139,7 @@
             if(this.Command == KEEPALIVE)
             {
                 dataOut.Write(NEWLINE);
+                dataOut.Flush();
                 return;
             }
 
diff --git a/src/main/csharp/Transport/InactivityMonitor.cs b/src/main/csharp/Transport/InactivityMonitor.cs
index cc41f30..9985422 100644
--- a/src/main/csharp/Transport/InactivityMonitor.cs
+++ b/src/main/csharp/Transport/InactivityMonitor.cs
@@ -103,7 +103,7 @@
         
         public void CheckConnection(object state)
         {
-            Tracer.DebugFormat("Timer Elapsed at {0}", DateTime.Now.ToLocalTime());
+            Tracer.DebugFormat("CheckConnection: Timer Elapsed at {0}", DateTime.Now.ToLocalTime());
 
             // First see if we have written or can write.
             WriteCheck();
@@ -125,16 +125,16 @@
                 return;
             }
 
-//            if(!commandSent.Value)
-//            {
-                Tracer.Debug("No Message sent since last write check. Sending a KeepAliveInfo");
+            if(!commandSent.Value)
+            {
+                //Tracer.Debug("No Message sent since last write check. Sending a KeepAliveInfo");
                 this.asyncWriteTask.IsPending = true;
                 this.asyncTasks.Wakeup();
-//            }
-//            else
-//            {
-//                Tracer.Debug("Message sent since last write check. Resetting flag");
-//            }
+            }
+            else
+            {
+                Tracer.Debug("Message sent since last write check. Resetting flag");
+            }
 
             commandSent.Value = false;
         }
@@ -180,7 +180,7 @@
         /// <returns></returns>
         public bool AllowReadCheck(TimeSpan elapsed)
         {
-            return (elapsed.TotalMilliseconds > (readCheckTime + readCheckTime * 0.90) );
+            return (elapsed.TotalMilliseconds > (readCheckTime * 2) );
         }
         #endregion
 
@@ -211,6 +211,16 @@
                         }
                     }
                 }
+                else if(command.IsKeepAliveInfo)
+                {
+                    if(Tracer.IsDebugEnabled)
+                    {
+                        Tracer.Debug("InactivityMonitor: New Keep Alive Received at -> " +
+                                     DateTime.Now.ToLongTimeString().TrimEnd(" APM".ToCharArray()) +
+                                     "." + DateTime.Now.Millisecond);
+                    }
+                }
+
                 base.OnCommand(sender, command);
             }
             finally
@@ -420,7 +430,7 @@
                     try
                     {
                         KeepAliveInfo info = new KeepAliveInfo();
-                        this.parent.Oneway(info);
+                        this.parent.next.Oneway(info);
                     }
                     catch(IOException e)
                     {