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
I actually just fixed a problem similar to this, except with pipes (Is php's fopen incompatible with the POSIX open for pipes). I don't know to what extent the solution would be similar, but maybe worth a look? I agree with RageD that you should stick a cout between the read and write lines just to test and see if the C++ is hanging on the sock >> data line or the sock << data line...