hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: timeout while waiting from reponse body ?
Date Thu, 12 Aug 2004 12:54:14 GMT

Setting socket timeout to a positive value will do the trick

HttpClient client = new HttpClient();
client.setTimeout(60000); // 60 sec timeout

-----Original Message-----
From: Mathias Cianci [mailto:mcianci@axecibles.com]
Sent: Thursday, August 12, 2004 2:50 PM
To: Commons HttpClient Project
Subject: timeout while waiting from reponse body ?

Hello everybody,

Sometimes, when this code line is executed :
byte[] responseBody = method.getResponseBody();
my thread is blocked because the response is not coming.

Is there a way to put something like a timeout in order to stop the
thread after 1minute if  the response is not coming ?

Hope an HttpClient-lover will give me an answer


The information in this email is confidential and may be legally privileged.  Access to this
email by anyone other than the intended addressee is unauthorized.  If you are not the intended
recipient of this message, any review, disclosure, copying, distribution, retention, or any
action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. 
If you are not the intended recipient, please reply to or forward a copy of this message to
the sender and delete the message, any attachments, and any copies thereof from your system.

To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message