org.eclipse.jetty.server.Response.flushBuffer()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中org.eclipse.jetty.server.Response.flushBuffer方法的一些代码示例,展示了Response.flushBuffer的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.flushBuffer方法的具体详情如下:
包路径:org.eclipse.jetty.server.Response
类名称:Response
方法名:flushBuffer

Response.flushBuffer介绍

暂无

代码示例

代码示例来源:origin: jooby-project/jooby

@Override
protected void handshake(final Runnable handler) throws Exception {
 /** Infinite timeout because the continuation is never resumed but only completed on close. */
 req.getAsyncContext().setTimeout(0L);
 /** Server sent events headers. */
 rsp.setStatus(HttpServletResponse.SC_OK);
 rsp.setHeader("Connection", "Close");
 rsp.setContentType("text/event-stream; charset=utf-8");
 rsp.flushBuffer();
 HttpChannel channel = rsp.getHttpChannel();
 Connector connector = channel.getConnector();
 Executor executor = connector.getExecutor();
 executor.execute(handler);
}

代码示例来源:origin: com.github.tomakehurst/wiremock-jre8

@Override
public void malformedResponseChunk() {
  try {
    response.setStatus(200);
    response.flushBuffer();
    socket.getChannel().write(BufferUtil.toBuffer(GARBAGE));
    socket.close();
  } catch (IOException e) {
    throwUnchecked(e);
  }
}

代码示例来源:origin: com.github.tomakehurst/wiremock-jre8

@Override
public void malformedResponseChunk() {
  try {
    response.setStatus(200);
    response.flushBuffer();
    writeGarbageThenCloseSocket();
  } catch (IOException e) {
    throwUnchecked(e);
  }
}

代码示例来源:origin: jenkinsci/winstone

private void minimalErrorResponse(Throwable failure)
{
  try
  {        
    int code = 500;
    Integer status=(Integer)_request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
    if (status!=null)
      code = status.intValue();
    else
    {
      Throwable cause = unwrap(failure,BadMessageException.class);
      if (cause instanceof BadMessageException)
        code = ((BadMessageException)cause).getCode();
    }
    
    _response.reset(true);
    _response.setStatus(code);
    _response.flushBuffer();
  }
  catch (Throwable x)
  {
    if (x != failure)
      failure.addSuppressed(x);
    abort(failure);
  }
}

代码示例来源:origin: stackoverflow.com

if (response.setErrorReported()) {
  try {
  response.flushBuffer();
 } catch (Throwable t) {
  ExceptionUtils.handleThrowable(t);

代码示例来源:origin: org.jooby/jooby-jetty

@Override
protected void handshake(final Runnable handler) throws Exception {
 /** Infinite timeout because the continuation is never resumed but only completed on close. */
 req.getAsyncContext().setTimeout(0L);
 /** Server sent events headers. */
 rsp.setStatus(HttpServletResponse.SC_OK);
 rsp.setHeader("Connection", "Close");
 rsp.setContentType("text/event-stream; charset=utf-8");
 rsp.flushBuffer();
 HttpChannel channel = rsp.getHttpChannel();
 Connector connector = channel.getConnector();
 Executor executor = connector.getExecutor();
 executor.execute(handler);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

if (_etags)
    r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
  r.flushBuffer();
  return false;
if (_etags)
  r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
r.flushBuffer();
return false;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

if (_etags)
    r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
  r.flushBuffer();
  return false;
if (_etags)
  r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
r.flushBuffer();
return false;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

if (_etags)
    r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
  r.flushBuffer();
  return false;
if (_etags)
  r.getHttpFields().add(HttpHeaders.ETAG_BUFFER,content.getETag());
r.flushBuffer();
return false;

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

r.flushBuffer();
  return false;
r.flushBuffer();
return false;

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

r.flushBuffer();
  return false;
r.flushBuffer();
return false;

相关文章