title: PHP socket_write works first time, but
body: <p>I am tying to write several messages (each message created dynamically) to a device through one socket created with PHP. The first message always goes through; but, subsequent messages do <em>not</em> go through. To help me debug, please let me know if there is a problem with this example:</p>
  
  <pre><code>        $socket= socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
          socket_connect($socket, $ip, $port); 
          socket_write($socket, "message 1\r");
          socket_write($socket, "message 2\r");
  </code></pre>