title: Writing and Reading from a socket a second time
body: <p>I connect to the whois server and am able to retrieve the availability of a domain name.
  Somehow I am not able to get a response back using the same connection when I do a request of a different domain name.</p>
  <pre><code>&lt;?php
  $context = stream_context_create();
  if($fp = stream_socket_client(&quot;tcp://whois.eu:43&quot;, $errno, $errstr, 30, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $context)) {
  
      stream_set_timeout($fp, 30);
      
      $domains = array('test.eu','amaai.eu');
      foreach($domains as $domain) {  
          fwrite($fp, $domain.&quot;\r\n&quot;);
          $contents = '';
          while (!feof($fp)) {
              $contents .= fread($fp, 8192);
          }
  
          echo $domain.&quot;: &quot;.$contents;
      }
  
      fclose($fp);
  }
  </code></pre>
  <p>What am I missing?
  I really want to use the same connection.</p>