Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4435855

http keepalive does not work with HEAD method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • core-libs
    • beta2
    • generic
    • generic



      Name: boT120536 Date: 04/09/2001


      java version "1.3.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
      Classic VM (build 1.3.0_02, green threads, nojit)


      Keepalive does not work with HTTP HEAD method

      The program is below.
      first argument - URL to track.
      start and do
      netstat -a
      in a different window.
      With HEAD it creates new connection for every request,
      with GET - keepalaive seems working.

      public class tt2 {
          public static void main(String []args) throws Exception
          {
      for(int i=0;i<1000;i++) {
      final java.net.URL url=new java.net.URL(args[0]+i);
      java.net.HttpURLConnection hconn =(java.net.HttpURLConnection)url.openConnection();
      hconn.setRequestMethod("HEAD");
      hconn.setUseCaches(true);
      hconn.connect();
      hconn.getInputStream().close();
      System.err.println("Try "+url);
      }
          }
      }
      (Review ID: 120374)
      ======================================================================

            alanb Alan Bateman
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: