title: It's possible open multiple connections to multiple sites using only one thread?
body: <h2>Update</h2>
  
  <p>I use a <code>FixedThreadPool</code> already. What happens is that each thread open one connection for one site. What I want to do is something asynchronous.</p>
  
  <ol>
  <li>Send request to a server</li>
  <li>Go to next request without need to wait the first request to complete</li>
  <li>When a request was established, do something informing another thread that connection was established and ready for download.</li>
  </ol>
  
  <p>I think this will speed up the execution because will use less threads for opening the same or more connection that the currently performance.</p>
  
  <p>In the current way, each thread wait a time without work waiting the connection establishes. In this new way, it will be always working.</p>
  
  <hr>
  
  <h2>The Question</h2>
  
  <p>I want to know if there is a way to open connection to multiple sites with only one thread. </p>
  
  <p>This is because I'm doing an webcrawler, I already did a thread to open a connection, but after a certain number of threads, this will not help because the processor sharing will increase a lot.</p>
  
  <p>I want this to speed up the number of pages downloaded. It's possible do this? How?</p>
  
  <p><strong>This code open a connection and do some processing. It's executed by the threads that open a connection</strong> </p>
  
  <pre><code>/*
   * Open connection to a server
   */
  boolean openConnection(Link link) throws Exception {
      //set the connection paramenters
      HttpURLConnection conn = (HttpURLConnection) new URL(link.getOriginalURL().getURL()).openConnection();
      conn.setRequestProperty("User-Agent", ROBOT_NAME);
      conn.setInstanceFollowRedirects(true);
      conn.setConnectTimeout(READ_TIMEOUT);
      conn.setReadTimeout(READ_TIMEOUT);
      link.setConnection(conn);
      //open the connection
      conn.connect();        
      //check the server answer
      if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {
          return false;
      }
      //analyse the URL of the redirected URL
      urlAnalyzer.fillURL(link.getRedirectedURL(), getRedirectedURL(link.getConnection()));
      return true;
  }
  </code></pre>
  
  <p><strong>This executes the connection openers, each one in one thread</strong></p>
  
  <pre><code>/*
   * Start the execution of the connection openers     
   */
  private void executeConnectionOpeners() {
      LOGGER.info("Starting connection openners.");
      /* Execution */
      NameThreadFactory ntf = new NameThreadFactory("Connection Opener");
      crawlerOpenerExecutor = Executors.newFixedThreadPool(nOpeners, ntf);
      for (int i = 0; i &lt; nOpeners; i++) {
          crawlerOpenerExecutor.submit(new ConnectionOpener(this));
      }
      /* End of execution */
      LOGGER.info(nOpeners + " connection openers created and running.");
  }
  </code></pre>