I am using PHP to connect to a local C++ socket server to keep state between a web app and a couple of daemons. I can send data to the socket server, but not receive from it; i
You can also try this when reading from socket:
if(socket_recv ( $socket , $response , 2048 , MSG_PEEK)!==false) { echo "Server said: $response"; }
Note: Using MSG_WAITALL in place of MSG_PEEK might cause socket to hang (from one experience I once had).