React/ZMQ/Ratchet - Websocket server response

后端 未结 2 1603
广开言路
广开言路 2021-01-26 16:02

I\'ve currently got a web socket server running and working with Ratchet PHP. I\'m not at the stage where I want external scripts to communicate with my server. I can successful

2条回答
  •  耶瑟儿~
    2021-01-26 16:07

    You have this line in your pull.php:

    echo $socket->recv();
    

    Push socket is for sending messages, not receiving them. That's probably where the exception comes from.

    Also: The first parameter of method on() on pull sockets should be 'message'.

    $pull->on('message', array($pusher, 'onPull'));
    

提交回复
热议问题