I am using latest Netbeans 5.0 JRE 1.5.. does it make a difference? What JRE would I need to use for the timeout to work?
-----Original Message----- From: Oleg Kalnichevski [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 3:52 AM To: Jakarta Commons Users List Subject: Re: [commons-httpclient] setConnectionTimeout not working? On Mon, 2006-04-24 at 18:38 -0400, Alex wrote: > client = new HttpClient(); > > > > SimpleHttpConnectionManager mr = new SimpleHttpConnectionManager(); > > mr.getParams().setConnectionTimeout(1000); > > client = new HttpClient(mr); > > > > > > long startTime = System.currentTimeMillis(); > > int resultCode = client.executeMethod(getMethod); > > setConnTime(System.currentTimeMillis()-startTime); > > > > > > my connection timeout is set to 1000 (1 second), output shows that > connection to some site took over 3-4 seconds and > > it never comes to "catch (ConnectTimeoutException e)" > > > > > > why is it not throwing ConnectTimeoutException? > What's the JRE version that you are using? Try connecting to the host using a plain java.net.Socket and see if it times out on connect. Oleg --------------------------------------------------------------------- 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]
