Author: fhanik Date: Thu Feb 22 12:11:50 2007 New Revision: 510639 URL: http://svn.apache.org/viewvc?view=rev&rev=510639 Log: Add in configuration options to control the application buffers associated with a NioChannel
Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=510639&r1=510638&r2=510639 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Thu Feb 22 12:11:50 2007 @@ -807,13 +807,13 @@ if (sslContext != null) { SSLEngine engine = createSSLEngine(); int appbufsize = engine.getSession().getApplicationBufferSize(); - NioBufferHandler bufhandler = new NioBufferHandler(Math.max(appbufsize,getReadBufSize()), - Math.max(appbufsize,getWriteBufSize()), + NioBufferHandler bufhandler = new NioBufferHandler(Math.max(appbufsize,socketProperties.getAppReadBufSize()), + Math.max(appbufsize,socketProperties.getAppWriteBufSize()), socketProperties.getDirectBuffer()); channel = new SecureNioChannel(socket, engine, bufhandler, selectorPool); } else { - NioBufferHandler bufhandler = new NioBufferHandler(getReadBufSize(), - getWriteBufSize(), + NioBufferHandler bufhandler = new NioBufferHandler(socketProperties.getAppReadBufSize(), + socketProperties.getAppWriteBufSize(), socketProperties.getDirectBuffer()); channel = new NioChannel(socket, bufhandler); Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java?view=diff&rev=510639&r1=510638&r2=510639 ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SocketProperties.java Thu Feb 22 12:11:50 2007 @@ -62,6 +62,18 @@ protected int txBufSize = 43800; /** + * The application read buffer size in bytes. + * Default value is rxBufSize + */ + protected int appReadBufSize = rxBufSize; + + /** + * The application write buffer size in bytes + * Default value is txBufSize + */ + protected int appWriteBufSize = txBufSize; + + /** * NioChannel pool size for the endpoint, * this value is how many channels * -1 means unlimited cached, 0 means no cache @@ -223,6 +235,14 @@ return properties; } + public int getAppReadBufSize() { + return appReadBufSize; + } + + public int getAppWriteBufSize() { + return appWriteBufSize; + } + public int getDirectBufferPool() { return bufferPool; } @@ -297,6 +317,14 @@ public void setKeyCache(int keyCache) { this.keyCache = keyCache; + } + + public void setAppReadBufSize(int appReadBufSize) { + this.appReadBufSize = appReadBufSize; + } + + public void setAppWriteBufSize(int appWriteBufSize) { + this.appWriteBufSize = appWriteBufSize; } public void setDirectBufferPool(int directBufferPool) { Modified: tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml?view=diff&rev=510639&r1=510638&r2=510639 ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml Thu Feb 22 12:11:50 2007 @@ -404,6 +404,16 @@ <attribute name="socket.txBufSize" required="false"> <p>The socket send buffer (SO_SNDBUF) size in bytes. Default value is 43800</p> </attribute> + <attribute name="socket.appReadBufSize" required="false"> + <p>Each connection that is opened up in Tomcat get associated with a read and a write ByteBuffer + This attribute controls the size of these buffers. By default this read buffer is sized to match the + socket read buffer (SO_RCVBUF) value, but can be sized separately.</p> + </attribute> + <attribute name="socket.appWriteBufSize" required="false"> + <p>Each connection that is opened up in Tomcat get associated with a read and a write ByteBuffer + This attribute controls the size of these buffers. By default this write buffer is sized to match the + socket read buffer (SO_SNDBUF) value, but can be sized separately.</p> + </attribute> <attribute name="socket.bufferPool" required="false"> <p>The Nio connector uses a class called NioChannel that holds elements linked to a socket. To reduce garbage collection, the Nio connector caches these channel objects. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]