本文整理汇总了Java中org.apache.tomcat.util.net.SocketStatus.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java SocketStatus.ERROR属性的具体用法?Java SocketStatus.ERROR怎么用?Java SocketStatus.ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.tomcat.util.net.SocketStatus
的用法示例。
在下文中一共展示了SocketStatus.ERROR属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: event
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
public SocketState event(SocketStatus status)
throws IOException {
RequestInfo rp = request.getRequestProcessor();
try {
// If processing a write event, must flush any leftover bytes first
if (status == SocketStatus.OPEN_WRITE) {
// If the flush does not manage to flush all leftover bytes, the socket should
// go back to the poller.
if (!outputBuffer.flushLeftover()) {
return SocketState.LONG;
}
// The write notification is now done
writeNotification = false;
// Allow convenient synchronous blocking writes
response.setFlushLeftovers(true);
} else if (status == SocketStatus.OPEN_CALLBACK) {
// The resume notification is now done
resumeNotification = false;
} else if (status == SocketStatus.ERROR) {
// Set error flag right away
error = true;
}
containerThread.set(Boolean.TRUE);
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.event(request, response, status);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
log.error(sm.getString("http11processor.request.process"), t);
// 500 - Internal Server Error
response.setStatus(500);
error = true;
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
recycle();
return SocketState.CLOSED;
} else if (!comet) {
boolean pipelined = inputBuffer.nextRequest();
outputBuffer.nextRequest();
recycle();
return (pipelined) ? SocketState.CLOSED : SocketState.OPEN;
} else {
return SocketState.LONG;
}
}