Connection timeout not working

View: New views
1 Messages — Rating Filter:   Alert me  

Connection timeout not working

by Adim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I notice that the webClient.setTimeout() does not work all the times, when I use a few seconds timeout it works (1-5 seconds) but in my application I use 30 seconds which never happens or taken few minutes.
Here is the test case:
final WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_7);
webClient.setThrowExceptionOnScriptError(false);
webClient.setCssEnabled(false);
webClient.setRefreshHandler(new RefreshHandler() {
        public void handleRefresh(Page page, URL url, int seconds) throws IOException {
        }
});
webClient.setJavaScriptEnabled(false);
webClient.setThrowExceptionOnFailingStatusCode(false);
webClient.setTimeout(30000);
HtmlPage page2 = (HtmlPage) webClient.getPage("http://www.winwin.co.il/RealEstate/ForRent/Page.aspx");

Can someone please tell me how can I make the httpClient throw a timeout exception when needed?

Regards,
Adi.