Fixes #306028 (Enable TCP_NODELAY by default in client connectors).

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1385 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Simone Bordet 2010-03-16 15:31:20 +00:00
parent a4b09b44da
commit f9329e1a33
3 changed files with 7 additions and 2 deletions

View File

@ -47,6 +47,7 @@ jetty-7.0.2.RC0
+ Added IPAccessHandler
+ Updated Servlet3Continuation to final 3.0.20100224
+ 305997 Coalesce buffers in ChannelEndPoint.flush()
+ 306028 Enable TCP_NODELAY by default in client connectors
jetty-7.0.1.v20091125 25 November 2009
+ 274251 DefaultServlet supports exact match mode.

View File

@ -162,6 +162,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
SocketChannel channel = SocketChannel.open();
Address address = destination.isProxied() ? destination.getProxy() : destination.getAddress();
channel.configureBlocking( false );
channel.socket().setTcpNoDelay(true);
channel.connect(address.toSocketAddress());
_selectorManager.register( channel, destination );
ConnectTimeout connectTimeout = new ConnectTimeout(channel, destination);

View File

@ -54,6 +54,9 @@ class SocketConnector extends AbstractLifeCycle implements HttpClient.Connector
socket = SocketFactory.getDefault().createSocket();
}
socket.setSoTimeout(_httpClient.getSoTimeout());
socket.setTcpNoDelay(true);
Address address = destination.isProxied() ? destination.getProxy() : destination.getAddress();
socket.connect(address.toSocketAddress(), _httpClient.getConnectTimeout());