Code example for ResponseConnControl

0
            // Set up the HTTP service 
            this.httpService = new HttpService(inhttpproc, reqistry);
        } 
 
        @Override 
        public void run() { 
            System.out.println("Listening on port " + this.serversocket.getLocalPort());
            while (!Thread.interrupted()) {
                try { 
                    final int bufsize = 8 * 1024;
                    // Set up incoming HTTP connection 
                    final Socket insocket = this.serversocket.accept();
                    final DefaultBHttpServerConnection inconn = new DefaultBHttpServerConnection(bufsize);
                    System.out.println("Incoming connection from " + insocket.getInetAddress());
                    inconn.bind(insocket);
 
                    // Set up outgoing HTTP connection 
                    final Socket outsocket = new Socket(this.target.getHostName(), this.target.getPort());
                    final DefaultBHttpClientConnection outconn = new DefaultBHttpClientConnection(bufsize);
                    outconn.bind(outsocket);
                    System.out.println("Outgoing connection to " + outsocket.getInetAddress());