本文整理了Java中org.eclipse.jetty.io.EofException
类的一些代码示例,展示了EofException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EofException
类的具体详情如下:
包路径:org.eclipse.jetty.io.EofException
类名称:EofException
[英]A Jetty specialization of EOFException.
This is thrown by Jetty to distinguish between EOF received from the connection, vs and EOF thrown by some application talking to some other file/socket etc. The only difference in handling is that Jetty EOFs are logged less verbosely.
[中]EOFEException的码头专用。
Jetty抛出此命令是为了区分从连接接收的EOF、vs和与其他文件/套接字等通信的某个应用程序抛出的EOF。处理方面的唯一区别是Jetty EOF的记录不太详细。
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public int flushBuffer() throws IOException
{
if (!_lock.tryLock())
return 0;
try
{
if (!_endp.isOpen())
throw new EofException();
if (_buffer != null)
{
int flushed = _buffer.hasContent() ? _endp.flush(_buffer) : 0;
if (_closed && _buffer.length() == 0)
_endp.shutdownOutput();
return flushed;
}
return 0;
}
finally
{
_lock.unlock();
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public EofException(Throwable th)
{
if (th!=null)
initCause(th);
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
LOG.warn("HttpParser Full for {} ",_endp);
_buffer.clear();
throw new HttpException(HttpStatus.REQUEST_ENTITY_TOO_LARGE_413, "Request Entity Too Large: "+(_buffer==_body?"body":"head"));
int filled = _endp.fill(_buffer);
return filled;
LOG.debug(e);
throw (e instanceof EofException) ? e:new EofException(e);
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.io
if (LOG.isDebugEnabled())
LOG.debug("flushed {} {}", flushed, this);
throw new EofException(e);
if (!BufferUtil.isEmpty(b))
return false;
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
LOG.debug("{} flush enter {}", SslConnection.this, Arrays.toString(appOuts));
int consumed=0;
try
throw new EofException(new ClosedChannelException());
return false;
BufferUtil.compact(_encryptedOutput);
int pos = BufferUtil.flipToFill(_encryptedOutput);
SSLEngineResult wrapResult = _sslEngine.wrap(appOuts, _encryptedOutput);
if (DEBUG)
LOG.debug("{} wrap {}", SslConnection.this, wrapResult);
BufferUtil.flipToFlush(_encryptedOutput, pos);
if (wrapResult.bytesConsumed()>0)
consumed+=wrapResult.bytesConsumed();
getEndPoint().flush(_encryptedOutput);
LOG.debug("{} {} {}", this, wrapResult.getStatus(), BufferUtil.toDetailString(_encryptedOutput));
if (BufferUtil.hasContent(_encryptedOutput))
getEndPoint().flush(_encryptedOutput);
getEndPoint().close();
throw e;
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
int len = _endp.flush(_header);
if (len<0 || !_endp.isOpen())
throw new EofException();
if (len==0)
Thread.sleep(100);
LOG.debug(e);
throw new InterruptedIOException(e.toString());
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server
if (LOG.isDebugEnabled())
LOG.debug("{} generate: {} ({},{},{})@{}",
this,
result,
BufferUtil.toSummaryString(_header),
BufferUtil.toSummaryString(_content),
_lastContent,
_generator.getState());
throw new EofException("request lifecycle violation");
BufferUtil.clear(chunk);
BufferUtil.clear(_content);
if (BufferUtil.hasContent(chunk))
getEndPoint().write(this, _header, chunk, _content);
else
getEndPoint().write(this, _header, _content);
getEndPoint().write(this, _header);
else if (BufferUtil.hasContent(chunk))
代码示例来源:origin: org.eclipse.jetty.spdy/spdy-http-server
@Override
public void send(HttpGenerator.ResponseInfo info, ByteBuffer content, boolean lastContent, final Callback callback)
if (LOG.isDebugEnabled())
LOG.debug("Sending {} {} {} {} last={}", this, stream, info, BufferUtil.toDetailString(content), lastContent);
EofException exception = new EofException("stream closed");
callback.failed(exception);
return;
boolean hasContent = BufferUtil.hasContent(content) && !isHeadRequest;
boolean close = !hasContent && lastContent;
"Stream already committed!");
callback.failed(exception);
if (LOG.isDebugEnabled())
LOG.debug("Committed response twice.", exception);
return;
if (LOG.isDebugEnabled())
LOG.debug("Send content: {} on stream: {} lastContent={}", BufferUtil.toDetailString(content), stream,
lastContent);
stream.data(new ByteBufferDataInfo(endPoint.getIdleTimeout(), TimeUnit.MILLISECONDS, content, lastContent
), callback);
if (LOG.isDebugEnabled())
LOG.debug("No content and lastContent=true. Sending empty ByteBuffer to close stream: {}", stream);
stream.data(new ByteBufferDataInfo(endPoint.getIdleTimeout(), TimeUnit.MILLISECONDS,
BufferUtil.EMPTY_BUFFER, lastContent), callback);
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
while (event && BufferUtil.hasContent(_requestBuffer) && _parser.inContentState())
_parser.parseNext(_requestBuffer);
if (BufferUtil.isEmpty(_requestBuffer))
if (getEndPoint().isInputShutdown())
getEndPoint().fillInterested(_readBlocker);
LOG.debug("{} block readable on {}",this,_readBlocker);
_readBlocker.block();
int filled=getEndPoint().fill(_requestBuffer);
LOG.debug("{} block filled {}",this,filled);
if (filled<0)
throw new EofException(e);
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
LOG.warn("Ignoring extra content {}",content);
content.clear();
return;
if (_endp.isOutputShutdown())
throw new EofException();
flushBuffer();
if (_content != null && _content.length()>0)
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
throw new EofException();
LOG.warn(e);
if (_interruptable)
throw new InterruptedIOException(){{this.initCause(e);}};
代码示例来源:origin: Nextdoor/bender
_writeListener.onError(_onError==null?new EofException("Async closed"):_onError);
continue;
LOG.debug(e);
_channel.abort();
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
LOG.debug("flushed {} {}", flushed, this);
throw new EofException(e);
if (BufferUtil.isEmpty(b))
BufferUtil.clear(b);
else
all_flushed=false;
代码示例来源:origin: org.eclipse.jetty/http
int len = _endp.flush(_header);
if (len<0)
throw new EofException();
if (len==0)
Thread.sleep(100);
LOG.debug(e);
throw new InterruptedIOException(e.toString());
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
filled = _endp.fill(_buffer);
LOG.debug(e);
reset();
throw (e instanceof EofException) ? e : new EofException(e);
throw new EofException();
代码示例来源:origin: Nextdoor/bender
_writeListener.onError(_onError==null?new EofException("Async close"):_onError);
continue;
write(BufferUtil.hasContent(_aggregate)?_aggregate:BufferUtil.EMPTY_BUFFER,!_channel.getResponse().isIncluding());
LOG.debug(e);
_channel.abort();
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
throw new IllegalStateException(); // should never happen!
case 6:
len = _endp.flush(_header, _buffer, null);
break;
case 5:
len = _endp.flush(_header, _content, null);
break;
case 4:
len = _endp.flush(_header);
break;
case 3:
LOG.ignore(e);
throw (e instanceof EofException) ? e:new EofException(e);
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
private synchronized int flushBuffer() throws IOException
{
if (!_endp.isOpen())
throw new EofException();
if (_buffer!=null)
return _endp.flush(_buffer);
return 0;
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public void blockForOutput(long maxIdleTime) throws IOException
{
if (_endp.isBlocking())
{
try
{
flushBuffer();
}
catch(IOException e)
{
_endp.close();
throw e;
}
}
else
{
if (!_endp.blockWritable(maxIdleTime))
{
_endp.close();
throw new EofException("timeout");
}
flushBuffer();
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server
public void flush(long maxIdleTime) throws IOException
{
// block until everything is flushed
long now=System.currentTimeMillis();
long end=now+maxIdleTime;
Buffer content = _content;
Buffer buffer = _buffer;
if (content!=null && content.length()>0 || buffer!=null && buffer.length()>0 || isBufferFull())
{
flushBuffer();
while (now<end && (content!=null && content.length()>0 ||buffer!=null && buffer.length()>0))
{
if (!_endp.isOpen() || _endp.isOutputShutdown())
throw new EofException();
blockForOutput(end-now);
now=System.currentTimeMillis();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!