protected abstract void resetTimeouts();
+ /**
+ * Provides a mechanism for those connectors (currently only NIO) that need
+ * that need to set comment timeouts.
+ */
+ protected abstract void setCometTimeouts(SocketWrapper<S> socketWrapper);
+
public void endRequest() {
// Finish the handling of the request
(!isAsync() &&
statusDropsConnection(response.getStatus()));
}
+ setCometTimeouts(socketWrapper);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
@Override
+ protected void setCometTimeouts(SocketWrapper<Long> socketWrapper) {
+ // NO-OP for APR/native
+ return;
+ }
+
+
+ @Override
protected boolean breakKeepAliveLoop(SocketWrapper<Long> socketWrapper) {
// Do sendfile as needed: add socket to sendfile and end
if (sendfileData != null && !error) {
(!isAsync() &&
statusDropsConnection(response.getStatus()));
}
- // Comet support
- SelectionKey key = socketWrapper.getSocket().getIOChannel().keyFor(
- socketWrapper.getSocket().getPoller().getSelector());
- if (key != null) {
- NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
- if (attach != null) {
- attach.setComet(comet);
- if (comet) {
- Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout");
- if (comettimeout != null) attach.setTimeout(comettimeout.longValue());
- }
- }
- }
+ setCometTimeouts(socketWrapper);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
@Override
+ protected void setCometTimeouts(SocketWrapper<NioChannel> socketWrapper) {
+ // Comet support
+ SelectionKey key = socketWrapper.getSocket().getIOChannel().keyFor(
+ socketWrapper.getSocket().getPoller().getSelector());
+ if (key != null) {
+ NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) key.attachment();
+ if (attach != null) {
+ attach.setComet(comet);
+ if (comet) {
+ Integer comettimeout = (Integer) request.getAttribute("org.apache.tomcat.comet.timeout");
+ if (comettimeout != null) attach.setTimeout(comettimeout.longValue());
+ }
+ }
+ }
+ }
+
+
+ @Override
protected boolean breakKeepAliveLoop(
SocketWrapper<NioChannel> socketWrapper) {
// Do sendfile as needed: add socket to sendfile and end
(!isAsync() &&
statusDropsConnection(response.getStatus()));
}
-
+ setCometTimeouts(socketWrapper);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
@Override
+ protected void setCometTimeouts(SocketWrapper<Socket> socketWrapper) {
+ // NO-OP for BIO
+ return;
+ }
+
+
+ @Override
protected boolean breakKeepAliveLoop(SocketWrapper<Socket> socketWrapper) {
// If we don't have a pipe-lined request allow this thread to be
// used by another connection