diff options
Diffstat (limited to 'jurt/com/sun/star/lib/connections/socket/socketConnector.java')
-rw-r--r-- | jurt/com/sun/star/lib/connections/socket/socketConnector.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java index a0c49370c6b2..1d3c2b1b57c3 100644 --- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java +++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java @@ -131,8 +131,10 @@ public final class socketConnector implements XConnector { throw new ConnectionSetupException(e); } Socket socket = null; + boolean isLoopbackAddress = false; for (int i = 0; i < adr.length; ++i) { try { + isLoopbackAddress = adr[i].isLoopbackAddress(); socket = new Socket(adr[i], desc.getPort()); break; } catch (IOException e) { @@ -142,7 +144,9 @@ public final class socketConnector implements XConnector { } XConnection con; try { - if (desc.getTcpNoDelay() != null) + // we enable tcpNoDelay for loopback connections because + // it can make a significant speed difference on linux boxes. + if (desc.getTcpNoDelay() != null || isLoopbackAddress) socket.setTcpNoDelay(desc.getTcpNoDelay().booleanValue()); con = new SocketConnection(connectionDescription, socket); |