dcsimg
How can I send severals requests with the same URLConnection behind a HTTP proxy supporting only HTTP 1.0 ? Is it possible ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 14, 2002 10:12 AM

I'm using the Sun's implementation. I have set the RequestHeader "Connection": myURLConn.setRequestProperty("Connection","Keep-Alive"); The property : System.getProperties().put("http.keepAlive", "true"); I succeed in sending my request and receiving its response, but when the response is read the underlying sun.net.www.http.KeepAliveStream always close itself. My second request doesn't reach the server and my next read on the InputStream, of course, catch an EOFException ! Any idea ? Thanx in advance for your help !!!    More>>

I'm using the Sun's implementation.



I have set the RequestHeader "Connection":

myURLConn.setRequestProperty("Connection","Keep-Alive");



The property :

System.getProperties().put("http.keepAlive", "true");


I succeed in sending my request and receiving its response, but when the response is read the underlying sun.net.www.http.KeepAliveStream always close itself.
My second request doesn't reach the server and my next read on the InputStream, of course, catch an EOFException !



Any idea ? Thanx in advance for your help !!!

   <<Less

Re: How can I send severals requests with the same URLConnection behind a HTTP proxy supporting only HTTP 1.0 ? Is it possible ?

Posted By:   Kenneth_Mark  
Posted On:   Tuesday, May 14, 2002 10:48 AM

HTTP 1.0 do not use persistent connection and even
version 1.1 is persistent by default, there is no
garantee connection will maintain alive during
multiple request and response.

In my experience, there is no (up to Java 1.3.1) way
to control when connection is close so better to make
multiple connection, each for a pair resquest/response.
About | Sitemap | Contact