Package org.eclipse.jetty.io

Examples of org.eclipse.jetty.io.EofException


    private void write(Buffer buffer) throws IOException
    {
        if (_closed)
            throw new IOException("Closed");
        if (!_generator.isOpen())
            throw new EofException();
       
        // Block until we can add _content.
        while (_generator.isBufferFull())
        {
            _generator.blockForOutput(getMaxIdleTime());
            if (_closed)
                throw new IOException("Closed");
            if (!_generator.isOpen())
                throw new EofException();
        }

        // Add the _content
        _generator.addContent(buffer, Generator.MORE);
View Full Code Here


        // Handle any unfinished business?
        if (_content!=null && _content.length()>0 || _bufferChunked)
        {
            if (_endp.isOutputShutdown())
                throw new EofException();
            flushBuffer();
            if (_content != null && _content.length()>0)
            {
                if (_bufferChunked)
                {
View Full Code Here

            // nasty semi busy flush!
            while(_header.length()>0)
            {
                int len = _endp.flush(_header);
                if (len<0)
                    throw new EofException();
                if (len==0)
                    Thread.sleep(100);
            }
        }
        catch(InterruptedException e)
View Full Code Here

        if (_state != STATE_HEADER)
            return;

        // handle a reset
        if (isResponse() && _status==0)
            throw new EofException();

        if (_last && !allContentAdded)
            throw new IllegalStateException("last?");
        _last = _last | allContentAdded;
View Full Code Here

            return total;
        }
        catch (IOException e)
        {
            LOG.ignore(e);
            throw (e instanceof EofException) ? e:new EofException(e);
        }
    }
View Full Code Here

        else
        {
            if (!_endp.blockWritable(maxIdleTime))
            {
                _endp.close();
                throw new EofException("timeout");
            }

            flushBuffer();
        }
    }
View Full Code Here

    private final EarlyEofExceptionMapper mapper = new EarlyEofExceptionMapper();

    @Test
    public void testToReponse() {
        final Response reponse = mapper.toResponse(new EofException());
        Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), reponse.getStatus());
    }
View Full Code Here

                    if (ex!=null)
                        throw ex;

                    if (!isComplete() && !isIdle())
                        throw new EofException();

                    return -1;
                }
                length=_buffer.length();
            }
View Full Code Here

                return filled;
            }
            catch(IOException e)
            {
                LOG.debug(e);
                throw (e instanceof EofException) ? e:new EofException(e);
            }
        }

        return -1;
    }
View Full Code Here

                        continue;

                    if (!_endp.blockReadable(maxIdleTime))
                    {
                        _endp.close();
                        throw new EofException("timeout");
                    }
                }

                parseNext();
            }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.io.EofException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.