< prev index next >

test/sun/net/www/http/KeepAliveCache/B5045306.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 5045306 6356004 6993490

  27  * @library ../../httptest/
  28  * @build HttpCallback TestHttpServer HttpTransaction
  29  * @run main/othervm B5045306
  30  * @summary Http keep-alive implementation is not efficient
  31  */
  32 
  33 import java.net.*;
  34 import java.io.*;
  35 import java.lang.management.*;
  36 
  37 /* Part 1:
  38  * The http client makes a connection to a URL whos content contains a lot of
  39  * data, more than can fit in the socket buffer. The client only reads
  40  * 1 byte of the data from the InputStream leaving behind more data than can
  41  * fit in the socket buffer. The client then makes a second call to the http
  42  * server. If the connection port used by the client is the same as for the
  43  * first call then that means that the connection is being reused.
  44  *
  45  * Part 2:
  46  * Test buggy webserver that sends less data than it specifies in its




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 5045306 6356004 6993490
  27  * @modules java.base/sun.net.www
  28  * @library ../../httptest/
  29  * @build HttpCallback TestHttpServer HttpTransaction
  30  * @run main/othervm B5045306
  31  * @summary Http keep-alive implementation is not efficient
  32  */
  33 
  34 import java.net.*;
  35 import java.io.*;
  36 import java.lang.management.*;
  37 
  38 /* Part 1:
  39  * The http client makes a connection to a URL whos content contains a lot of
  40  * data, more than can fit in the socket buffer. The client only reads
  41  * 1 byte of the data from the InputStream leaving behind more data than can
  42  * fit in the socket buffer. The client then makes a second call to the http
  43  * server. If the connection port used by the client is the same as for the
  44  * first call then that means that the connection is being reused.
  45  *
  46  * Part 2:
  47  * Test buggy webserver that sends less data than it specifies in its


< prev index next >