Re: Http persistent connection with applets-----please help!

Jeff Nisewanger (Jeff.Nisewanger@eng.sun.com)
Thu, 11 Mar 1999 07:43:38 -0800 (PST)

Date: Thu, 11 Mar 1999 07:43:38 -0800 (PST)
From: Jeff Nisewanger <Jeff.Nisewanger@eng.sun.com>
Subject: Re: Http persistent connection with applets-----please help!
To: java-security@java.sun.com, grqureshi@hotmail.com

> As of me, Netscape has URL connection keep-alives.But I don't from what
> I am developing an Java applet-based chat application to supplement
> online shopping.This is like a product.
>
> For clients who are behind a firewall an HTTP based connection is
> required to by pass the proxy server.
>
> Hypertext Transfer Protocol originally allowed only one request per TCP
> connection. However, establishing a TCP connection is fairly expensive
> time wise, so I need an HTTP keep-alive to improve efficiency.
>
> version does it support it? Would you please let me know about it.
> What is the time interval of keep-alive cache?
>
> Does MSIE and other browsers like Oracle browser also support it ?

I don't know the answers to these questions offhand. Support
for HTTP persistent connections (Keep-Alive) will be transparent at the
Java URLConnection api level. When you create a java.net.URL and call
openConnection() to get the URLConnection instance your request will
automatically use a persistent HTTP connection if that is supported by
the HTTP URLStreamHandler installed with the JVM and if it is supported
by the proxy or HTTP server. If you are going through a proxy then it
is a seperate issue whether the proxy itself supports persistent connections
to the actual HTTP server.

The JDK itself supports persistent connections in JDK1.1.x
although the version of HTTP that the JDK supports is HTTP 1.0. This
will use persistent connections when connecting directly to an HTTP
server that supports persistent connections. Proxy servers are required
to not support persistent connections to HTTP 1.0 clients for various
historical technical reasons. In the current release of Java 2, we
turned off persistent connection support to work around bugs in the
implementation. A future Java release will likely support HTTP 1.1 on the
client side including persistent connections that will work with both
directly connected Web servers as well as HTTP proxy servers. I believe
IE and Netscape substitute their own built-in browser HTTP
URLStreamHandler instead of the default one in Sun's Java distribution.
You will have to either experiment with them or check their support
documentation or support email aliases/groups to find out about their
HTTP Keep-Alive support.

Jeff