title: stream_socket_client() not working and ignoring timeout
body: <p>I am trying to execute a <code>stream_socket_client()</code> from PHP to receive data from a Windows. Here's my environments:</p>
  
  <hr>
  
  <p><strong>Localhost</strong>: Windows 8 and PHP 5.3.8. <em>THE SCRIPT WORKS PERFECT AND TAKES 25 SECONDS.</em>
  <strong>Windows Telnet</strong>: From the Windows Telnet client, it works just fine. I can receive data from the server.
  <strong>External Server</strong>: centOS with PHP 5.3.3. THE SCRIPT TAKES UP TO 5 MINUTES TO TIMEOUT.
  <strong>Internal Server</strong>: centOS with PHP 5.3.3. THE SCRIPT NEVER TIMES OUT.</p>
  
  <p><em>Note:</em> for the Internal Server to work, the <code>$address</code> variable is changed to <code>192.168.0.7</code>.</p>
  
  <p>My question is more about what should I be looking for? Should I be worried about 5.3.3 Vs 5.3.8? Or is there something on Linux that I must focus on to make this work?</p>
  
  <ul>
  <li>I know is not a firewall problem, since from my machine works (located outside) and both, a external server and the internal server isn't working.</li>
  <li>I know the <code>allow_url_fopen</code> is set to 1.</li>
  </ul>
  
  <p>ini_set('max_execution_time', 30);</p>
  
  <pre><code>$address = 'xxxxxxxxxxxxxxxxxxx';
  $url = 'tcp://' . $address . ':6000';
  $fp = stream_socket_client($portao, $errno, $errstr, 10);    
  if (!$fp) {
      echo ("$errstr ($errno)&lt;br /&gt;\n");
      exit;    
  } else {
      $out = 'open 192.168.0.22' . PHP_EOL;
  
      fwrite($fp, $out);
  
      $output = 'Nothing here.';
  
      while (!feof($fp)) {
          $output = stream_get_contents($fp);
      }
  
  
      fclose($fp);    
      echo $output;
      exit;
  }
  </code></pre>