Hi, Peter, It sounds like you're doing everything right! Here's what I do in some production code of mine:
int timeout = 10000; MultiThreadedHttpConnectionManager m; m = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams p = m.getParams(); HttpClient c = new HttpClient( m ); c.getParams().setSoTimeout( timeout ); p.setConnectionTimeout( timeout ); If that doesn't fix your problem, probably something other than httpclient is causing the problem - maybe DNS lookup? Investigate how long this call takes on your machine: String hostname = // whatever host you're connecting to long start = System.currentTimeMillis(); InetAddress addr = InetAddress.getByName( hostname ); long end = System.currentTimeMillis(); System.out.println( "hostname lookup took: " + ( end - start ) + "ms" ); yours, Julius ps. what exact version of JRockit are you using? And what version of an operating system (linux 2.6 or windows xp or what?). On Tue, 2006-14-02 at 16:51 +0100, Peter Wenngren wrote: > Hello gurus! > > I'm having problems with a very long Connection-timeout (about 3 > minutes!) time when trying to send a http-query to a non existing > server. I've tried to set the setSoTimeout() method on the HttpClient > instance and setConnectionManagerTimeout() on the > MultiThreadedHttpConnectionManager used by the HttpClient. But, no > success... > > How do I set the maximum amount of time to wait for a connection to a > non-existing host? > > I'm using HttpClient v.3.0 on a Bea WLS 8.14 running on jrockit JVM. > > Any suggestions on how I can abort the connection after a few > seconds/failed attempts to produce connection? > > Thanks! > > // Peter Wenngren > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Julius Davies Senior Application Developer, Technology Services Credit Union Central of British Columbia http://www.cucbc.com/ Tel: 604-730-6385 Cel: 604-868-7571 Fax: 604-737-5910 1441 Creekside Drive Vancouver, BC Canada V6J 4S7 http://juliusdavies.ca/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
