summaryrefslogtreecommitdiff
path: root/io/source/connector/connector.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-11 13:54:04 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-01-20 10:40:44 +0000
commitc9e6b5854197dd33d4e20ed78aee8382472a0f01 (patch)
tree644a9acc2b74a9f2812f686304455f023886661a /io/source/connector/connector.cxx
parent473c20d86ea0cdd1307bfd5c89f89c3ba2c316a1 (diff)
enable tcpNoDelay for loopback connections automatically
it can make a significant speed difference for applications talking to the office binary via UNO Change-Id: If6e901908fe6a6119ac1fd0bf8feebabe5602ff7 Reviewed-on: https://gerrit.libreoffice.org/13856 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'io/source/connector/connector.cxx')
-rw-r--r--io/source/connector/connector.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 0aca22cc1685..81bfdb64ddb2 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -132,7 +132,9 @@ namespace stoc_connector
delete pConn;
throw NoConnectException( sMessage );
}
- if( bTcpNoDelay )
+ // we enable tcpNoDelay for loopback connections because
+ // it can make a significant speed difference on linux boxes.
+ if( bTcpNoDelay || aHost == "localhost" || aHost.startsWith("127.0.0.") )
{
sal_Int32 nTcpNoDelay = sal_True;
pConn->m_socket.setOption( osl_Socket_OptionTcpNoDelay , &nTcpNoDelay,