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);
protected int txBufSize = 43800;\r
\r
/**\r
+ * The application read buffer size in bytes.\r
+ * Default value is rxBufSize\r
+ */\r
+ protected int appReadBufSize = rxBufSize;\r
+ \r
+ /**\r
+ * The application write buffer size in bytes\r
+ * Default value is txBufSize\r
+ */\r
+ protected int appWriteBufSize = txBufSize;\r
+ \r
+ /**\r
* NioChannel pool size for the endpoint,\r
* this value is how many channels\r
* -1 means unlimited cached, 0 means no cache\r
return properties;\r
}\r
\r
+ public int getAppReadBufSize() {\r
+ return appReadBufSize;\r
+ }\r
+\r
+ public int getAppWriteBufSize() {\r
+ return appWriteBufSize;\r
+ }\r
+\r
public int getDirectBufferPool() {\r
return bufferPool;\r
}\r
this.keyCache = keyCache;\r
}\r
\r
+ public void setAppReadBufSize(int appReadBufSize) {\r
+ this.appReadBufSize = appReadBufSize;\r
+ }\r
+\r
+ public void setAppWriteBufSize(int appWriteBufSize) {\r
+ this.appWriteBufSize = appWriteBufSize;\r
+ }\r
+\r
public void setDirectBufferPool(int directBufferPool) {\r
this.bufferPool = directBufferPool;\r
}\r
<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.