KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a way to specify a timeout for the whole execution of HttpClient ? I have tried the following: httpClient.getParams().setParameter("http.socket.timeout", timeout * 1000); httpClient.getParams().setParameter("http.connection.timeout", timeout * 1000); httpClient.getParams().setParameter("http.connection-manager.timeout", new Long(timeout * 1000)); httpClient.getParams().setParameter("http.protocol.head-body-timeout", timeout * 1000); It actually works fine, except if a remote host sends back data - even at one byte/second - it will continue to read forever! But I want to interrupt the connection in 10 seconds max, whether or not the host responds.
Tags (comma-separated)
Save Edits
Cancel