diff --git a/jetty-server/src/main/config/etc/jetty-http.xml b/jetty-server/src/main/config/etc/jetty-http.xml
index e93bb68dfc1..ba8a605febb 100644
--- a/jetty-server/src/main/config/etc/jetty-http.xml
+++ b/jetty-server/src/main/config/etc/jetty-http.xml
@@ -34,6 +34,10 @@
Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
@@ -399,7 +402,11 @@ public class ServerConnector extends AbstractNetworkConnector { try { - socket.setTcpNoDelay(true); + socket.setTcpNoDelay(_acceptedTcpNoDelay); + if (_acceptedReceiveBufferSize > -1) + socket.setReceiveBufferSize(_acceptedReceiveBufferSize); + if (_acceptedSendBufferSize > -1) + socket.setSendBufferSize(_acceptedSendBufferSize); } catch (SocketException e) { @@ -479,6 +486,7 @@ public class ServerConnector extends AbstractNetworkConnector * @return whether the server socket reuses addresses * @see ServerSocket#getReuseAddress() */ + @ManagedAttribute("Server Socket SO_REUSEADDR") public boolean getReuseAddress() { return _reuseAddress; @@ -493,6 +501,67 @@ public class ServerConnector extends AbstractNetworkConnector _reuseAddress = reuseAddress; } + /** + * @return whether the accepted socket gets {@link java.net.SocketOptions#TCP_NODELAY TCP_NODELAY} enabled. + * @see Socket#getTcpNoDelay() + */ + @ManagedAttribute("Accepted Socket TCP_NODELAY") + public boolean getAcceptedTcpNoDelay() + { + return _acceptedTcpNoDelay; + } + + /** + * @param tcpNoDelay whether {@link java.net.SocketOptions#TCP_NODELAY TCP_NODELAY} gets enabled on the the accepted socket. + * @see Socket#setTcpNoDelay(boolean) + */ + public void setAcceptedTcpNoDelay(boolean tcpNoDelay) + { + this._acceptedTcpNoDelay = tcpNoDelay; + } + + /** + * @return the {@link java.net.SocketOptions#SO_RCVBUF SO_RCVBUF} size to set onto the accepted socket. + * A value of -1 indicates that it is left to its default value. + * @see Socket#getReceiveBufferSize() + */ + @ManagedAttribute("Accepted Socket SO_RCVBUF") + public int getAcceptedReceiveBufferSize() + { + return _acceptedReceiveBufferSize; + } + + /** + * @param receiveBufferSize the {@link java.net.SocketOptions#SO_RCVBUF SO_RCVBUF} size to set onto the accepted socket. + * A value of -1 indicates that it is left to its default value. + * @see Socket#setReceiveBufferSize(int) + */ + public void setAcceptedReceiveBufferSize(int receiveBufferSize) + { + this._acceptedReceiveBufferSize = receiveBufferSize; + } + + /** + * @return the {@link java.net.SocketOptions#SO_SNDBUF SO_SNDBUF} size to set onto the accepted socket. + * A value of -1 indicates that it is left to its default value. + * @see Socket#getSendBufferSize() + */ + @ManagedAttribute("Accepted Socket SO_SNDBUF") + public int getAcceptedSendBufferSize() + { + return _acceptedSendBufferSize; + } + + /** + * @param sendBufferSize the {@link java.net.SocketOptions#SO_SNDBUF SO_SNDBUF} size to set onto the accepted socket. + * A value of -1 indicates that it is left to its default value. + * @see Socket#setSendBufferSize(int) + */ + public void setAcceptedSendBufferSize(int sendBufferSize) + { + this._acceptedSendBufferSize = sendBufferSize; + } + @Override public void setAccepting(boolean accepting) {