title: fsockopen not working?
body: <p>I am trying to connect to an IRC server via PHP on a command line using Windows 7.</p>
  
  <p>Everytime when running this:</p>
  
  <pre><code>$socket = fsockopen($irc_server, 6667, $errno, $errstr, 5);
  </code></pre>
  
  <p><code>$errno</code> = 0, <code>$errstr</code> = "" and <code>$socket</code> = 'Resource id #4' (using <code>die($socket);</code>)</p>
  
  <p>What is the cause of this, and how can I debug more into this.</p>
  
  <p>The following code:</p>
  
  <pre><code>$s = fsockopen("google.com", 80, $errno, $errstr, 5);
  die($errno.", ".$errstr.", ".$s);
  </code></pre>
  
  <p>...returns the following:</p>
  
  <pre><code>0, , Resource id #4
  </code></pre>
  
  <p>I can't use <code>$socket</code>. It says "Invalid resource" when I try to use it. Also, the PHP documentation notes that errno 0 indicates a wrongly opened socket.</p>
  
  <p>Help is appreciated.</p>