Hello Manish,
What you're doing here looks good. It sounds like you're getting a socket read timeout which is caused by a large delay when reading the response. I'm not sure what you mean by "read partial responses". The only options I can think of are setting the SO_TIMEOUT to a higher value, or working on the server side to increase its performance.
Mike
On Aug 22, 2004, at 8:27 AM, Manish Moorjani wrote:
Hi,
I am using HttpClient for automatic login into third Party Applications and then fetching the page and displaying it to the end user.
The page I am trying to fetch queries the database based on a search key and fetches more than 2000 records to display on the screen.
I am using the following code to fetch the response
StringBuffer sReply =new StringBuffer("");
InputStream rbas = method.getResponseBodyAsStream();
InputStreamReader isr = new InputStreamReader (rbas, "UTF8" /* "UTF8" */);
BufferedReader br = new BufferedReader (isr);
while ((temp = (br.readLine())) != null) {
sReply.append(temp+ "\r\n");
}
String strReply=sReply.toString();
method.releaseConnection();
br.close();
isr.close();
rbas.close();
}
But as the response is large sometimes the request times out before the response is obtained.
Is there a way possible to read partial responses and displaying them on the screen ???
Or the only option is to set the timeout time to max possible ?
One more thing the records are fetched quite fast when I directly access the url
Regards,
Manish Moorjani
Infosys Technologies Ltd.
Phone: 91-44-24509530/40/50 Extn. 80395
"If you are still amazed by something you accomplished yesterday then today has been a waste"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]