Code example for DefaultConnectionReuseStrategy

0
            httpproc.addInterceptor(new ResponseServer());
            httpproc.addInterceptor(new ResponseContent());
            httpproc.addInterceptor(new ResponseConnControl());
             
            // Set up the HTTP service 
            new HttpService(httpproc, new DefaultConnectionReuseStrategy(),
                    new DefaultHttpResponseFactory());
        } 
         
        public void stopServer() { 
            try { 
                this.serversocket.close();
            } catch (IOException e) {
                e.printStackTrace();
            } 
        } 
         
        @Override 
        public void run() { 
            Log.d(TAG, "*** Listening on port " + this.serversocket.getLocalPort());
            while (running) {