Package org.apache.tomcat.lite.http

Examples of org.apache.tomcat.lite.http.HttpRequest


        reqCnt = thr * perthr;
        long t0 = System.currentTimeMillis();

        tr = new ThreadRunner(thr, perthr) {
            public void makeRequest(int i) throws Exception {
                HttpRequest cstate = clientCon.request("localhost",
                        ssl ? 8443 : 8802);
                synchronized (active) {
                    active.put(cstate, cstate);
                }
                if (spdy) {
                    // Magic way to force spdy - will be replaced with
                    // a negotiation.
                    cstate.setProtocol("SPDY/1.0");
                }
                if (ssl) {
                    cstate.setSecure(true);
                }
                cstate.requestURI().set("/hello");
                cstate.setCompletedCallback(reqCallback);
                // no body
                cstate.getBody().close();

                cstate.send();

                while (active.size() >= thr) {
                    synchronized(thrlock) {
                        thrlock.wait();
                    }
View Full Code Here


     */
    public static BBuffer get(String url) throws IOException {

        BBuffer out = BBuffer.allocate();

        HttpRequest aclient = HttpClient.newClient().request(url);
        aclient.send();
        aclient.readAll(out,
                //Long.MAX_VALUE);//
                2000000);
        aclient.release(); // return connection to pool
        return out;
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.lite.http.HttpRequest

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.