当前位置: 首页>>代码示例>>Java>>正文


Java SocketStatus.ERROR属性代码示例

本文整理汇总了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;
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:57,代码来源:Http11AprProcessor.java


注:本文中的org.apache.tomcat.util.net.SocketStatus.ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。