protected ServerSocket serverSocket = null;
+ // ------------------------------------------------------------ Constructor
+
+ public JIoEndpoint() {
+ // Set maxConnections to zero so we can tell if the user has specified
+ // their own value on the connector when we reach bind()
+ setMaxConnections(0);
+ }
+
// ------------------------------------------------------------- Properties
/**
if (acceptorThreadCount == 0) {
acceptorThreadCount = 1;
}
+ // Initialize maxConnections
+ if (getMaxConnections() == 0) {
+ // User hasn't set a value - use the default
+ setMaxConnections(getMaxThreads());
+ }
+
if (serverSocketFactory == null) {
if (isSSLEnabled()) {
serverSocketFactory =
connectionTimeout attribute.</p>
</attribute>
+ <attribute name="maxConnections" required="false">
+ <p>The maximum number of connections that the server will accept and
+ process at any given time. When this number has been reached, the server
+ will not accept any more connections until the number of connections
+ falls below this value. The operating system may still accept
+ connections based on the <code>acceptCount</code> setting. Default value
+ varies by connector type. For BIO the default is the value of
+ <strong>maxThreads</strong>.For APR/native, the default is
+ <code>8192</code>.</p>
+ <p>Note that for APR/native on Windows, the configured value will be
+ reduced to the highest multiple of 1024 that is less than or equal to
+ maxConnections. This is done for performance reasons.</p>
+ </attribute>
+
<attribute name="maxThreads" required="false">
<p>The maximum number of request processing threads to be created
by this <strong>Connector</strong>, which therefore determines the
will not accept any more connections until the number of connections
falls below this value. The operating system may still accept
connections based on the <code>acceptCount</code> setting. Default value
- varies by connector type. For BIO and NIO the default is
- <code>10000</code>. For APR/native, the default is <code>8192</code>.</p>
+ varies by connector type. For BIO the default is the value of
+ <strong>maxThreads</strong>. For NIO the default is <code>10000</code>.
+ For APR/native, the default is <code>8192</code>.</p>
<p>Note that for APR/native on Windows, the configured value will be
reduced to the highest multiple of 1024 that is less than or equal to
maxConnections. This is done for performance reasons.</p>
<p>Below is a small chart that shows how the connectors differentiate.</p>
<source>
- Java Blocking Connector Java Nio Blocking Connector APR/native Connector
- BIO NIO APR
- Classname Http11Protocol Http11NioProtocol Http11AprProtocol
- Tomcat Version 3.x onwards 6.x onwards 5.5.x onwards
- Support Polling NO YES YES
- Polling Size N/A Unlimited - Restricted by mem Unlimited - Configurable
- Read HTTP Request Blocking Non Blocking Blocking
- Read HTTP Body Blocking Sim Blocking Blocking
- Write HTTP Response Blocking Sim Blocking Blocking
- SSL Support Java SSL Java SSL OpenSSL
- SSL Handshake Blocking Non blocking Blocking
- Max Connections maxConnections See polling size See polling size
+ Java Blocking Connector Java Nio Blocking Connector APR/native Connector
+ BIO NIO APR
+ Classname Http11Protocol Http11NioProtocol Http11AprProtocol
+ Tomcat Version 3.x onwards 6.x onwards 5.5.x onwards
+ Support Polling NO YES YES
+ Polling Size N/A maxConnections maxConnections
+ Read HTTP Request Blocking Non Blocking Blocking
+ Read HTTP Body Blocking Sim Blocking Blocking
+ Write HTTP Response Blocking Sim Blocking Blocking
+ SSL Support Java SSL Java SSL OpenSSL
+ SSL Handshake Blocking Non blocking Blocking
+ Max Connections maxConnections maxConnections maxConnections
</source>