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
TCP sockets usually try to combine multiple small send calls into one packet to avoid sending too many packets (Nagle's algorithm). This may be the cause that you can't receive anything after the send() call. You will have to open the socket with TCP_NODELAY to avoid that.