httpclient: Setting a Timeout

S

Snyke

Hi,

I'm writing an application that needs to check the reachability of some
hosts. I decided httpclient would be the nicest thing to use in my
case. My Problem now is that no matter if I set a timeout using the
following code:

client.getParams().setParameter("http.socket.timeout", new
Integer(1000));

the application hangs and really much time is lost waiting for the code
above to terminate. Is there a safe and secure way to ensure that the
whole connection Progress including domain name resolving, connection,
request sending and response receiving does not take longer than a
certain amount of time? In most cases the application just hangs trying
to connect to a certain host.

Could you help me?

Greets, Snyke
 
J

John C. Bollinger

Snyke said:
I'm writing an application that needs to check the reachability of some
hosts. I decided httpclient would be the nicest thing to use in my
case. My Problem now is that no matter if I set a timeout using the
following code:

client.getParams().setParameter("http.socket.timeout", new
Integer(1000));

the application hangs and really much time is lost waiting for the code
above to terminate. Is there a safe and secure way to ensure that the
whole connection Progress including domain name resolving, connection,
request sending and response receiving does not take longer than a
certain amount of time? In most cases the application just hangs trying
to connect to a certain host.

See my response to "Brent" in thread "Jakarta's Latest HttpClient". If
you are the same as he then stop posting the same question multiple
times. If you and he are working on this project together, then please
coordinate your advice-seeking. In any other case, it may please you to
know that your competition is stuck at the same place you are.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top