I ask for help, I can not configure the subject. In Linux, zero. There are VPS, Ubuntu, Redis. Installed Workerman. It works in terms of "sent a message from the site’s muzzle - the server answered." I try to adjust now sending to the specific user. The local handler looks like this:
$ws_worker->onWorkerStart = function() use (&$users) { // создаём локальный tcp-сервер, чтобы отправлять на него сообщения из кода нашего сайта $inner_tcp_worker = new Worker("tcp://0.0.0.0:1234"); // создаём обработчик сообщений, который будет срабатывать, // когда на локальный tcp-сокет приходит сообщение $inner_tcp_worker->onMessage = function($connection, $data) use (&$users) { $data = json_decode($data); // отправляем сообщение пользователю по userId if (isset($users[$data->user])) { $webconnection = $users[$data->user]; $webconnection->send($data->message); } }; $inner_tcp_worker->listen(); }; At attempt of restart workerman writes Warning: stream_socket_server(): unable to connect to tcp://0.0.0.0:1234 (Address already in use) in /var/www/html/ws/workerman/Worker.php on line 2179 Exception: Address already in use in /var/www/html/ws/workerman/Worker.php:2181
How can I beat a mistake? Thank?