activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1151865 - in /activemq/activemq-apollo/trunk: apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java apollo-website/src/documentation/user-manual.md
Date Thu, 28 Jul 2011 14:24:35 GMT
Author: chirino
Date: Thu Jul 28 14:24:34 2011
New Revision: 1151865

URL: http://svn.apache.org/viewvc?rev=1151865&view=rev
Log:
Fixes APLO-68 : Add support for TCP-level keepalive

Modified:
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md

Modified: activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java?rev=1151865&r1=1151864&r2=1151865&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/TcpTransport.java
Thu Jul 28 14:24:34 2011
@@ -182,6 +182,7 @@ public class TcpTransport extends JavaBa
     int max_write_rate;
     int receive_buffer_size = 1024*64;
     int send_buffer_size = 1024*64;
+    boolean keep_alive = true;
 
 
     public static final int IPTOS_LOWCOST = 0x02;
@@ -347,6 +348,10 @@ public class TcpTransport extends JavaBa
         } catch (SocketException e) {
         }
         try {
+            socket.setKeepAlive(keep_alive);
+        } catch (SocketException e) {
+        }
+        try {
             socket.setTcpNoDelay(true);
         } catch (SocketException e) {
         }
@@ -801,4 +806,12 @@ public class TcpTransport extends JavaBa
     public void setSend_buffer_size(int send_buffer_size) {
         this.send_buffer_size = send_buffer_size;
     }
+
+    public boolean isKeep_alive() {
+        return keep_alive;
+    }
+
+    public void setKeep_alive(boolean keep_alive) {
+        this.keep_alive = keep_alive;
+    }
 }

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md?rev=1151865&r1=1151864&r2=1151865&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md Thu Jul
28 14:24:34 2011
@@ -171,6 +171,9 @@ settings used on the socket.  The suppor
 * `send_buffer_size` : Sets the size of the internal socket send buffer.  
    Defaults to 65536 (64k)
 
+* `keep_alive` : Enable or disable the SO_KEEPALIVE socket option.  
+   Defaults to true.
+
 * `traffic_class` : Sets traffic class or type-of-service octet in the IP 
   header for packets sent from the transport.  Defaults to `8` which
   means the traffic should be optimized for throughput.



Mime
View raw message