Package org.eclipse.jetty.io

Examples of org.eclipse.jetty.io.ByteArrayEndPoint


        public void run()
        {
            try
            {
                ByteArrayEndPoint endPoint = new ByteArrayEndPoint(_requestsBuffer.asArray(), 1024)
                {
                    @Override
                    public void setConnection(Connection connection)
                    {
                        if (getConnection()!=null && connection!=getConnection())
                            connectionUpgraded(getConnection(),connection);
                        super.setConnection(connection);
                    }
                };

                endPoint.setGrowOutput(true);
                AbstractHttpConnection connection = new BlockingHttpConnection(LocalConnector.this, endPoint, getServer());
                endPoint.setConnection(connection);
                connectionOpened(connection);

                boolean leaveOpen = _keepOpen;
                try
                {
                    while (endPoint.getIn().length() > 0 && endPoint.isOpen())
                    {
                        while (true)
                        {
                            final Connection con = endPoint.getConnection();
                            final Connection next = con.handle();
                            if (next!=con)
                            { 
                                endPoint.setConnection(next);
                                continue;
                            }
                            break;
                        }
                    }
                }
                catch (IOException x)
                {
                    LOG.debug(x);
                    leaveOpen = false;
                }
                catch (Exception x)
                {
                    LOG.warn(x);
                    leaveOpen = false;
                }
                finally
                {
                    if (!leaveOpen)
                        connectionClosed(connection);
                    _responsesBuffer = endPoint.getOut();
                }
            }
            finally
            {
                if (_latch != null)
View Full Code Here

TOP

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

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.