/** * This endpoint does not support <code>-1</code> for unlimited connections, * nor does it support setting this attribute while the endpoint is running. * * {@inheritDoc} */ @Override public void setMaxConnections(int maxConnections) { if (maxConnections == -1) { log.warn(sm.getString("endpoint.apr.maxConnections.unlimited", Integer.valueOf(getMaxConnections()))); return; } if (running) { log.warn(sm.getString("endpoint.apr.maxConnections.running", Integer.valueOf(getMaxConnections()))); return; } super.setMaxConnections(maxConnections); }
/** * Create the poller. With some versions of APR, the maximum poller size * will be 62 (recompiling APR is necessary to remove this limitation). */ protected void init() { pool = Pool.create(serverSockPool); int size = getMaxConnections() / pollerThreadCount; int socketTimeout = socketProperties.getSoTimeout(); connectionPollset = allocatePoller(size, pool, socketTimeout); if (connectionPollset == 0 && size > 1024) { size = 1024; connectionPollset = allocatePoller(size, pool, socketTimeout); } if (connectionPollset == 0) { size = 62; connectionPollset = allocatePoller(size, pool, socketTimeout); } desc = new long[size * 2]; keepAliveCount = 0; addSocket = new long[size]; addSocketTimeout = new int[size]; addSocketFlags = new int[size]; addCount = 0; }
if ((OS.IS_WIN32 || OS.IS_WIN64) && (getMaxConnections() > 1024)) { pollerThreadCount = getMaxConnections() / 1024; getMaxConnections() - (getMaxConnections() % 1024)); } else {
int defaultPollerSize = getMaxConnections();
int defaultPollerSize = getMaxConnections();
if ((OS.IS_WIN32 || OS.IS_WIN64) && (getMaxConnections() > 1024)) { pollerThreadCount = getMaxConnections() / 1024; getMaxConnections() - (getMaxConnections() % 1024)); } else {
int size = getMaxConnections() / pollerThreadCount; int keepAliveTimeout = getKeepAliveTimeout(); int socketTimeout = socketProperties.getSoTimeout();
public void run() { SocketList localAddList = new SocketList(getMaxConnections()); SocketList localCloseList = new SocketList(getMaxConnections());
SocketList localAddList = new SocketList(getMaxConnections()); SocketList localCloseList = new SocketList(getMaxConnections());