title: PHP - error when using socket_recv
body: <p>I have a socket error when running the socket_recv inside this function:</p>
  
  <pre><code>function readByteXByteSIBmsg() {
      $msg = "";
      $buf="";
      try {
       while( $ret=socket_recv($this-&gt;kpSocket,$buf,8192,0)){
          $msg.=$buf;
          if($ret&lt;8192) break;
       }
  
  
      $this-&gt;deb_print("KpCore:readByteXByteSIBmsg:READ LOOP TERMINATED");
      } catch (Exception $e) {
          err_print("KPICore:readByteXByteSIBmsg:Exception on EVENT  HANDLER:RECEIVE:\n" . $e);
          $this-&gt;$KP_ERROR_ID = $this-&gt;ERR_SOCKET_TIMEOUT;
      }
      return $msg;
  }
  </code></pre>
  
  <p>This is the text of the error:</p>
  
  <pre><code>PHP Warning:  socket_recv(): unable to read from socket [11]: Resource temporarily unavailable in /home/luca/Documenti/Tesi/M3 Agent Page/lib/KPICore.php on line 236
  </code></pre>
  
  <p>(line 236 is the line with the socket_recv call)</p>