Code example for DefaultHttpResponseFactory

0
             
            // Set up the HTTP service 
            this.httpService = new HttpService(
                    httpproc, 
                    new DefaultConnectionReuseStrategy(), 
                    new DefaultHttpResponseFactory());
            this.httpService.setHandlerResolver(registry);
            this.httpService.setParams(params);
        } 
         
        public void run() { 
            Log.i(TAG,"Listening on port " + this.serversocket.getLocalPort());
            while (!Thread.interrupted()) {
                try { 
                    // Set up HTTP connection 
                    Socket socket = this.serversocket.accept();
                    DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
                    Log.d(TAG,"Incoming connection from " + socket.getInetAddress());
                    conn.bind(socket, this.params);
 
                    // Start worker thread