title: Handling HttpClient (Httpget) timeouts
body: <p>So I'm running a multithreaded program that makes a bunch of calls to api's and a few web-pages that it wants to scrape.   In some unusual cases the httpget will fail horribly and will cause the program to 'freeze' (the thread never exits, the threadpool never closes,main never exits, etc.)</p>
  
  <p>I need to set a timeout to the http connections that I'm making. I'm using a DefaultHttpClient </p>
  
  <pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();
  </code></pre>
  
  <p>and I'm not setting any params.   </p>
  
  <p>Can someone help me time these out or at least point me to where I should be looking for handling timeouts?  (Apache seems to have great libs that never seem to have good examples around)</p>