changeset 893:377d9cfb6fa1

Merge
author lana
date Wed, 09 Oct 2013 14:00:04 -0700
parents 47d37ba79129 b467f5b58bbc
children 47dded4c92d4
files .hgtags
diffstat 2 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Sep 12 17:17:16 2013 -0700
+++ b/.hgtags	Wed Oct 09 14:00:04 2013 -0700
@@ -342,4 +342,5 @@
 acb0571052b8dbef036fc50235ef95c0a46cff6b jdk7u40-b41
 b4a480a039bc19b27bfb5fcbbbf75e651d2718b7 jdk7u40-b42
 e29ea0b297e519010e661603a07bb8d48fa904a2 jdk7u40-b43
+08737d863a7aa5eb39374b26c9585e1770affe92 jdk7u40-b60
 c5b5886004e6446b8b27ccdc1fd073354c1dc614 jdk7u60-b00
--- a/src/share/classes/com/sun/corba/se/impl/transport/DefaultSocketFactoryImpl.java	Thu Sep 12 17:17:16 2013 -0700
+++ b/src/share/classes/com/sun/corba/se/impl/transport/DefaultSocketFactoryImpl.java	Wed Oct 09 14:00:04 2013 -0700
@@ -32,6 +32,7 @@
 import java.net.ServerSocket;
 import java.nio.channels.SocketChannel;
 import java.nio.channels.ServerSocketChannel;
+import java.security.PrivilegedAction;
 
 import com.sun.corba.se.pept.transport.Acceptor;
 
@@ -44,6 +45,22 @@
     implements ORBSocketFactory
 {
     private ORB orb;
+    private static final boolean keepAlive;
+
+    static {
+        keepAlive = java.security.AccessController.doPrivileged(
+            new PrivilegedAction<Boolean>() {
+                @Override
+                public Boolean run () {
+                    String value =
+                        System.getProperty("com.sun.CORBA.transport.enableTcpKeepAlive");
+                    if (value != null)
+                        return new Boolean(!"false".equalsIgnoreCase(value));
+
+                    return Boolean.FALSE;
+                }
+            });
+    }
 
     public void setORB(ORB orb)
     {
@@ -85,6 +102,9 @@
         // Disable Nagle's algorithm (i.e., always send immediately).
         socket.setTcpNoDelay(true);
 
+        if (keepAlive)
+            socket.setKeepAlive(true);
+
         return socket;
     }
 
@@ -95,6 +115,8 @@
     {
         // Disable Nagle's algorithm (i.e., always send immediately).
         socket.setTcpNoDelay(true);
+        if (keepAlive)
+            socket.setKeepAlive(true);
     }
 }