test/jdk/java/net/httpclient/ManyRequestsLegacy.java
branchhttp-client-branch
changeset 55942 8d4770c22b63
parent 55852 32f6aefec11e
child 55973 4d9b002587db
equal deleted inserted replaced
55941:2d423c9b73bb 55942:8d4770c22b63
   202         public void handle(HttpExchange e) throws IOException {
   202         public void handle(HttpExchange e) throws IOException {
   203             System.out.println("Server: received " + e.getRequestURI());
   203             System.out.println("Server: received " + e.getRequestURI());
   204             super.handle(e);
   204             super.handle(e);
   205         }
   205         }
   206         @Override
   206         @Override
   207         protected void close(OutputStream os) throws IOException {
   207         protected void close(HttpExchange t, OutputStream os) throws IOException {
   208             if (INSERT_DELAY) {
   208             if (INSERT_DELAY) {
   209                 try { Thread.sleep(rand.nextInt(200)); }
   209                 try { Thread.sleep(rand.nextInt(200)); }
   210                 catch (InterruptedException e) {}
   210                 catch (InterruptedException e) {}
   211             }
   211             }
       
   212             System.out.println("Server: close outbound: " + t.getRequestURI());
   212             os.close();
   213             os.close();
   213         }
   214         }
   214         @Override
   215         @Override
   215         protected void close(InputStream is) throws IOException {
   216         protected void close(HttpExchange t, InputStream is) throws IOException {
   216             if (INSERT_DELAY) {
   217             if (INSERT_DELAY) {
   217                 try { Thread.sleep(rand.nextInt(200)); }
   218                 try { Thread.sleep(rand.nextInt(200)); }
   218                 catch (InterruptedException e) {}
   219                 catch (InterruptedException e) {}
   219             }
   220             }
       
   221             System.out.println("Server: close inbound: " + t.getRequestURI());
   220             is.close();
   222             is.close();
   221         }
   223         }
   222     }
   224     }
   223 
   225 
   224     static void test(HttpsServer server, LegacyHttpClient client) throws Exception {
   226     static void test(HttpsServer server, LegacyHttpClient client) throws Exception {