Code example for DefaultConnectionReuseStrategy

0
            reqistry.register("*", new HttpFileHandler());
 
            // Set up the HTTP service 
            this.httpService = new HttpService(
                    httpproc,
                    new DefaultConnectionReuseStrategy(),
                    new DefaultHttpResponseFactory());
            this.httpService.setParams(this.params);
            this.httpService.setHandlerResolver(reqistry);
 
            workers = new ArrayList<Worker>();
        } 
 
        @Override 
        public void run() { 
            running = new AtomicBoolean(true);
 
            while (running.get()) {
                try { 
                    // Set up HTTP connection 
                    Socket socket = this.serversocket.accept();