Can't read from socket (hangs)

前端 未结 4 1554
深忆病人
深忆病人 2021-02-06 07:17

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

4条回答
  •  囚心锁ツ
    2021-02-06 08:00

    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...

提交回复
热议问题