S
S
Silverviql2018-07-16 11:40:56
Yii
Silverviql, 2018-07-16 11:40:56

How to implement ratchet websocket push?

I tried to remake and run a websocket push on yii2 following the example from this video https://www.youtube.com/watch?v=wXCORk5xXPs&t=139s..
An example code can be seen here:
https://github.com/3u3ik/cp lucky-wifi.ru/blob/fa4...
https://github.com/3u3ik/cp.lucky-wifi.ru/blob/fa4...
https://github.com/3u3ik/cp.lucky- wifi.ru/blob/fa4...

The essence of the problem is that if you register everything as in the example, an error occurs when starting the server.

Argument 2 passed to React\Socket\Server::__construct() must implement interface React\EventLoop\LoopInterface, none given.

If the constructor function is changed to:
public function __construct()
    {
        parent::__construct($this->id, $this->module);
    }

That gives the following error:
PHP Fatal Error 'yii\base\ErrorException' with message 'Call to a member function getUniqueId() on null'

Any help or advice is appreciated.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question