Package org.apache.http

Examples of org.apache.http.ConnectionClosedException


        throws IOException, HttpException, ParseException {

        this.lineBuf.clear();
        final int i = sessionBuffer.readLine(this.lineBuf);
        if (i == -1) {
            throw new ConnectionClosedException("Client closed connection");
        }
        final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
        final RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
        return this.requestFactory.newHttpRequest(requestline);
    }
View Full Code Here


            return -1;
        }
        final int b = this.in.read();
        if (b == -1) {
            if (pos < contentLength) {
                throw new ConnectionClosedException(
                        "Premature end of Content-Length delimited message body (expected: "
                        + contentLength + "; received: " + pos);
            }
        } else {
            pos++;
View Full Code Here

        if (pos + len > contentLength) {
            len = (int) (contentLength - pos);
        }
        final int count = this.in.read(b, off, len);
        if (count == -1 && pos < contentLength) {
            throw new ConnectionClosedException(
                    "Premature end of Content-Length delimited message body (expected: "
                    + contentLength + "; received: " + pos);
        }
        if (count > 0) {
            pos += count;
View Full Code Here

            }

            this.localContext.setAttribute(HttpCoreContext.HTTP_CONNECTION, managedConn);

            if (!managedConn.isOpen()) {
                failed(new ConnectionClosedException("Connection closed"));
            } else {
                this.managedConn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this);
                this.managedConn.requestOutput();
            }
        } catch (final RuntimeException runex) {
View Full Code Here

            if (!this.state.isRouteEstablished()) {
                this.state.setRouteTracker(new RouteTracker(this.state.getRoute()));
            }

            if (!managedConn.isOpen()) {
                failed(new ConnectionClosedException("Connection closed"));
            } else {
                this.managedConn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this);
                this.managedConn.requestOutput();
            }
        } catch (final RuntimeException runex) {
View Full Code Here

            }
            conn.getContext().setAttribute(HttpAsyncRequestExecutor.HTTP_HANDLER, this);
            conn.requestOutput();
            this.routeEstablished = route.equals(conn.getRoute());
            if (!conn.isOpen()) {
                throw new ConnectionClosedException("Connection closed");
            }
        } catch (final IOException ex) {
            failed(ex);
        } catch (final RuntimeException runex) {
            failed(runex);
View Full Code Here

        return this.hasBufferedOutput;
    }
   
    protected void assertNotClosed() throws IOException {
        if (this.status != ACTIVE) {
            throw new ConnectionClosedException("Connection is closed");
        }
    }
View Full Code Here

            return -1;
        }
        final int b = this.in.read();
        if (b == -1) {
            if (pos < contentLength) {
                throw new ConnectionClosedException(
                        "Premature end of Content-Length delimited message body (expected: "
                        + contentLength + "; received: " + pos);
            }
        } else {
            pos++;
View Full Code Here

        if (pos + len > contentLength) {
            chunk = (int) (contentLength - pos);
        }
        final int count = this.in.read(b, off, chunk);
        if (count == -1 && pos < contentLength) {
            throw new ConnectionClosedException(
                    "Premature end of Content-Length delimited message body (expected: "
                    + contentLength + "; received: " + pos);
        }
        if (count > 0) {
            pos += count;
View Full Code Here

        throws IOException, HttpException, ParseException {

        this.lineBuf.clear();
        final int i = sessionBuffer.readLine(this.lineBuf);
        if (i == -1) {
            throw new ConnectionClosedException("Client closed connection");
        }
        final ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
        final RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
        return this.requestFactory.newHttpRequest(requestline);
    }
View Full Code Here

TOP

Related Classes of org.apache.http.ConnectionClosedException

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.