title: Timeout in DefaultHttpClient
body: <p>I'm a little confused on how the timeouts in DefaultHttpClient work.</p>
  
  <p>I'm using this code:</p>
  
  <pre><code>private DefaultHttpClient createHttpClient() {
          HttpParams my_httpParams = new BasicHttpParams();
  
          HttpConnectionParams.setConnectionTimeout(my_httpParams, 3000);
          HttpConnectionParams.setSoTimeout(my_httpParams, 15000);
  
          SchemeRegistry registry = new SchemeRegistry();
          registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
          ThreadSafeClientConnManager multiThreadedConnectionManager = new ThreadSafeClientConnManager(my_httpParams, registry);
  
          DefaultHttpClient httpclient = new DefaultHttpClient(multiThreadedConnectionManager, my_httpParams);
  
          return httpclient;
  }
  </code></pre>
  
  <p>.</p>
  
  <pre><code>String url = "http://www.example.com";
  
  DefaultHttpClient httpclient = createHttpClient();
  HttpGet httpget = new HttpGet(url);
  
  try {
      HttpResponse response = httpclient.execute(httpget);
      StatusLine statusLine = response.getStatusLine();
      mStatusCode = statusLine.getStatusCode();
  
      if (mStatusCode == 200){
          content = EntityUtils.toString(response.getEntity());
      }
  
  } catch (ClientProtocolException e) {
      e.printStackTrace();
  } catch (IOException e) {
      e.printStackTrace();
  } catch (IllegalStateException e){
      e.printStackTrace();
  }
  </code></pre>
  
  <p>When 15 seconds have passed and not all data has been received, an exception will be thrown, right? But on which method? I thought it to be the <code>.execute(httpget)</code> method but that one only tells me it throws <code>ClientProtocolException</code> and <code>IOException</code>. Could anyone help me clearifying this?</p>