title: socket_create vs. fsockopen php
body: <p>The hosting service that I use currently does not let me use sockets, probably for good reason on their part. They do, however, let me use <i>fsockopen</i>. I was wondering what the difference is, because some scripts that worked with <i>socket_create</i> and even <i>stream_socket_server</i>, do not work with <i>fsockopen</i>. That said, if <i>fsockopen</i> should work, my code is listed below. What it does is it listens on its own ip address for incoming udp packets and reads them.</p>
  
  <p>Thanks</p>
  
  <pre><code>$sock = fsockopen("udp://x.x.x.x", $port);
  while(1)
  {
      $buf = fread($sock, 200);
      flush();
      ob_flush();
  }
  </code></pre>