public int getConnectionTimeout() { // Note that the endpoint uses the alternative name return endpoint.getSoTimeout(); } public void setConnectionTimeout(int timeout) {
public int getConnectionTimeout() { // Note that the endpoint uses the alternative name return endpoint.getSoTimeout(); } public void setConnectionTimeout(int timeout) {
public int getConnectionTimeout() { // Note that the endpoint uses the alternative name return endpoint.getSoTimeout(); } public void setConnectionTimeout(int timeout) {
public int getConnectionTimeout() { // Note that the endpoint uses the alternative name return endpoint.getSoTimeout(); } public void setConnectionTimeout(int timeout) {
public int getKeepAliveTimeout() { if (keepAliveTimeout == null) { return getSoTimeout(); } else { return keepAliveTimeout.intValue(); } } public void setKeepAliveTimeout(int keepAliveTimeout) {
public int getKeepAliveTimeout() { if (keepAliveTimeout == null) { return getSoTimeout(); } else { return keepAliveTimeout.intValue(); } } public void setKeepAliveTimeout(int keepAliveTimeout) {
public int getKeepAliveTimeout() { if (keepAliveTimeout == null) { return getSoTimeout(); } else { return keepAliveTimeout.intValue(); } } public void setKeepAliveTimeout(int keepAliveTimeout) {
socket.getSocket().setSoTimeout(endpoint.getSoTimeout());
if (endpoint.getSoTimeout()> 0) { setSocketTimeout(endpoint.getSoTimeout()); } else { setSocketTimeout(0);
socket.getSocket().setSoTimeout(endpoint.getSoTimeout());
Socket.timeoutSet(socket, endpoint.getSoTimeout() * 1000); } else { Socket.timeoutSet(socket, 0);
@Override protected void resetTimeouts() { final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false); if (!error && attach != null && asyncStateMachine.isAsyncDispatching()) { long soTimeout = endpoint.getSoTimeout(); //reset the timeout if (keepAlive) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); } } }
@Override protected void resetTimeouts() { final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false); if (!error && attach != null && asyncStateMachine.isAsyncDispatching()) { long soTimeout = endpoint.getSoTimeout(); //reset the timeout if (keepAlive) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); } } }
@Override protected void resetTimeouts() { final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socket.getSocket().getAttachment(false); if (!error && attach != null && asyncStateMachine.isAsyncDispatching()) { long soTimeout = endpoint.getSoTimeout(); //reset the timeout if (keepAlive) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); } } }
@Override protected void resetTimeouts() { // The NIO connector uses the timeout configured on the wrapper in the // poller. Therefore, it needs to be reset once asycn processing has // finished. final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false); if (!error && attach != null && asyncStateMachine.isAsyncDispatching()) { long soTimeout = endpoint.getSoTimeout(); //reset the timeout if (keepAliveTimeout > 0) { attach.setTimeout(keepAliveTimeout); } else { attach.setTimeout(soTimeout); } } }
@Override protected void longPoll(SocketWrapper<Long> socket, Processor<Long> processor) { connections.put(socket.getSocket(), processor); if (processor.isAsync()) { // Async socket.setAsync(true); } else if (processor.isComet()) { // Comet if (proto.endpoint.isRunning()) { ((AprEndpoint) proto.endpoint).getCometPoller().add( socket.getSocket().longValue(), proto.endpoint.getSoTimeout(), AprEndpoint.Poller.FLAGS_READ); } else { // Process a STOP directly ((AprEndpoint) proto.endpoint).processSocket( socket.getSocket().longValue(), SocketStatus.STOP); } } else { // Upgraded ((AprEndpoint) proto.endpoint).getPoller().add( socket.getSocket().longValue(), processor.getUpgradeInbound().getReadTimeout(), AprEndpoint.Poller.FLAGS_READ); } }
@Override protected void longPoll(SocketWrapper<Long> socket, Processor<Long> processor) { if (processor.isAsync()) { // Async socket.setAsync(true); } else if (processor.isComet()) { // Comet if (proto.endpoint.isRunning()) { socket.setComet(true); ((AprEndpoint) proto.endpoint).getPoller().add( socket.getSocket().longValue(), proto.endpoint.getSoTimeout(), true, false); } else { // Process a STOP directly ((AprEndpoint) proto.endpoint).processSocket( socket.getSocket().longValue(), SocketStatus.STOP); } } else { // Upgraded Poller p = ((AprEndpoint) proto.endpoint).getPoller(); if (p == null) { // Connector has been stopped release(socket, processor, true, false); } else { p.add(socket.getSocket().longValue(), -1, true, false); } } }
@Override protected boolean handleIncompleteRequestLineRead() { // Haven't finished reading the request so keep the socket // open openSocket = true; // Check to see if we have read any of the request line yet if (inputBuffer.getParsingRequestLinePhase() < 2) { if (socket.getLastAccess() > -1 || keptAlive) { // Haven't read the request line and have previously processed a // request. Must be keep-alive. Make sure poller uses keepAlive. socket.setTimeout(endpoint.getKeepAliveTimeout()); } } else { // Started to read request line. Need to keep processor // associated with socket readComplete = false; // Make sure poller uses soTimeout from here onwards socket.setTimeout(endpoint.getSoTimeout()); } if (endpoint.isPaused()) { // 503 - Service unavailable response.setStatus(503); adapter.log(request, response, 0); error = true; } else { return true; } return false; }
@Override protected boolean handleIncompleteRequestLineRead() { // Haven't finished reading the request so keep the socket // open openSocket = true; // Check to see if we have read any of the request line yet if (inputBuffer.getParsingRequestLinePhase() < 2) { if (socket.getLastAccess() > -1 || keptAlive) { // Haven't read the request line and have previously processed a // request. Must be keep-alive. Make sure poller uses keepAlive. socket.setTimeout(endpoint.getKeepAliveTimeout()); } } else { // Started to read request line. Need to keep processor // associated with socket readComplete = false; // Make sure poller uses soTimeout from here onwards socket.setTimeout(endpoint.getSoTimeout()); } if (endpoint.isPaused()) { // 503 - Service unavailable response.setStatus(503); adapter.log(request, response, 0); error = true; } else { return true; } return false; }
@Override protected boolean handleIncompleteRequestLineRead() { // Haven't finished reading the request so keep the socket // open openSocket = true; // Check to see if we have read any of the request line yet if (((InternalNioInputBuffer) inputBuffer).getParsingRequestLinePhase() < 2) { if (socketWrapper.getLastAccess() > -1 || keptAlive) { // Haven't read the request line and have previously processed a // request. Must be keep-alive. Make sure poller uses keepAlive. socketWrapper.setTimeout(endpoint.getKeepAliveTimeout()); } } else { // Started to read request line. Need to keep processor // associated with socket readComplete = false; // Make sure poller uses soTimeout from here onwards socketWrapper.setTimeout(endpoint.getSoTimeout()); } if (endpoint.isPaused()) { // 503 - Service unavailable response.setStatus(503); getAdapter().log(request, response, 0); error = true; } else { return true; } return false; }