title: How can I keep alive a connection socket after write from client PHP to server C++
body: <p>I'm trying to make a socket connection between a PHP aplication and a C++ aplication, but I don't know why I can't keep alive the connection between those 2 applications after I wrote from PHP. This is my socket-client:</p>
  
  <pre><code>$host    = "172.12.10.1";
  $port    = '7054';
  $factory = new Factory();
  $socket = $factory-&gt;createClient($host.':'.$port);
  echo 'Client connected to ' . $socket-&gt;getPeerName() . PHP_EOL . PHP_EOL."&lt;br&gt;";
  $strSndMsg="TEST";
  $socket-&gt;write($strSndMsg);
  var_dump($socket-&gt;read(8192));
  $socket-&gt;close();
  </code></pre>
  
  <p>So like I said,  after <code>$socket-&gt;write($strSndMsg)</code> was executed the C++ app show me "Client connect- Cliente disconnect - Test" but I didn't get a response in my $socket->read(8192). Can somebody help me please!?</p>