Package org.apache.http.impl

Examples of org.apache.http.impl.DefaultHttpServerConnection


                        outstream.write(tmp);
                        outstream.flush();
                       
                        // do something comletely ugly in order to trigger
                        // MalformedChunkCodingException
                        DefaultHttpServerConnection conn = (DefaultHttpServerConnection)
                            context.getAttribute(ExecutionContext.HTTP_CONNECTION);
                        try {
                            conn.sendResponseHeader(response);
                        } catch (HttpException ignore) {
                        }
                    }
                   
                } ;
View Full Code Here


        protected void accept() throws IOException {
            // Set up HTTP connection
            Socket socket = servicedSocket.accept();
            acceptedConnections.incrementAndGet();
            DefaultHttpServerConnection conn =
                new DefaultHttpServerConnection();
            conn.bind(socket, serverParams);

            // Set up the HTTP service
            HttpService httpService = new HttpService(
                httpProcessor,
                new DefaultConnectionReuseStrategy(),
View Full Code Here

            s_logger.info("ApiServer listening on port " + _serverSocket.getLocalPort());
            while (!Thread.interrupted()) {
                try {
                    // Set up HTTP connection
                    Socket socket = _serverSocket.accept();
                    DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    conn.bind(socket, _params);

                    // Execute a new worker task to handle the request
                    _executor.execute(new WorkerTask(_httpService, conn, _workerCount++));
                } catch (InterruptedIOException ex) {
                    break;
View Full Code Here

           
            while (!Thread.interrupted()) {
                try {
                    // Set up HTTP connection
                    Socket socket = this.serversocket.accept();
                    DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    System.out.println("Incoming connection from " + socket.getInetAddress());
                    conn.bind(socket, this.params);

                    // Start worker thread
                    Thread t = new WorkerThread(this.httpService, conn);
                    t.setDaemon(true);
                    t.start();
View Full Code Here

           
            while (!Thread.interrupted()) {
                try {
                    // Set up HTTP connection
                    Socket socket = this.serversocket.accept();
                    DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    System.out.println("Incoming connection from " + socket.getInetAddress());
                    conn.bind(socket, this.params);

                    // Start worker thread
                    Thread t = new WorkerThread(this.httpService, conn);
                    t.setDaemon(true);
                    t.start();
View Full Code Here

        protected void accept() throws IOException {
            // Set up HTTP connection
            Socket socket = servicedSocket.accept();
            acceptedConnections.incrementAndGet();
            DefaultHttpServerConnection conn =
                new DefaultHttpServerConnection();
            conn.bind(socket, serverParams);

            // Set up the HTTP service
            HttpService httpService = new HttpService(
                httpProcessor,
                reuseStrategy,
View Full Code Here

                        outstream.write(tmp);
                        outstream.flush();
                       
                        // do something comletely ugly in order to trigger
                        // MalformedChunkCodingException
                        DefaultHttpServerConnection conn = (DefaultHttpServerConnection)
                            context.getAttribute(ExecutionContext.HTTP_CONNECTION);
                        try {
                            conn.sendResponseHeader(response);
                        } catch (HttpException ignore) {
                        }
                    }
                   
                } ;
View Full Code Here

           
            while (_serverSocket != null) {
                try {
                    // Set up HTTP connection
                    Socket socket = _serverSocket.accept();
                    final DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    conn.bind(socket, _params);

                    _executor.execute(new Runnable() {
                      public void run() {
                            HttpContext context = new BasicHttpContext(null);
                            try {
                              while(!Thread.interrupted() && conn.isOpen()) {
                                if(s_logger.isTraceEnabled())
                                  s_logger.trace("dispatching cluster request from " + conn.getRemoteAddress().toString());
                               
                                  _httpService.handleRequest(conn, context);
                                 
                                if(s_logger.isTraceEnabled())
                                  s_logger.trace("Cluster request from " + conn.getRemoteAddress().toString() + " is processed");
                              }
                            } catch (ConnectionClosedException ex) {
                              // client close and read time out exceptions are expected
                              // when KEEP-AVLIE is enabled
                                s_logger.trace("Client closed connection", ex);
                            } catch (IOException ex) {
                                s_logger.trace("I/O error", ex);
                            } catch (HttpException ex) {
                                s_logger.error("Unrecoverable HTTP protocol violation", ex);
                            } finally {
                                try {
                                    conn.shutdown();
                                } catch (IOException ignore) {
                                    s_logger.error("unexpected exception", ignore);
                                }
                            }
                      }
View Full Code Here

            s_logger.info("ApiServer listening on port " + _serverSocket.getLocalPort());
            while (!Thread.interrupted()) {
                try {
                    // Set up HTTP connection
                    Socket socket = _serverSocket.accept();
                    DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    conn.bind(socket, _params);

                    // Execute a new worker task to handle the request
                    _executor.execute(new WorkerTask(_httpService, conn, _workerCount++));
                } catch (InterruptedIOException ex) {
                    break;
View Full Code Here

    public void run() {
        while (!Thread.interrupted()) {
            try {
                // Set up HTTP connection
                final Socket socket = _serversocket.accept();
                final DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                System.out.println("Incoming connection from " + socket.getInetAddress());
                conn.bind(socket, _params);

                // Start worker thread
                final Thread t = new WorkerThread(_httpService, conn);
                t.setDaemon(true);
                t.start();
View Full Code Here

TOP

Related Classes of org.apache.http.impl.DefaultHttpServerConnection

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.