Shkarbatov Dmitriy
Shkarbatov Dmitriy
**1)** I think you may have misunderstood me, will try to explaine. - when page is rendered I create connection with socketServer (send user id to server) - SocketServer runs...
Yes and yes. I think, I can extend the loop circul, and call once in 3 seckonds my method that sending data to clients. Whay You think abut this?
Can we create something like this: [https://github.com/Shkarbatov/WebSocketPHPWorkerman/blob/master/worker.php](https://github.com/Shkarbatov/WebSocketPHPWorkerman/blob/master/worker.php) ?
Can I send data from server to client with Hoa like I do this with workerman? Not sending every second request from web through WebSockets to server.
Thanks for answer, do you have any example?
**Trying next:** **Worker:** ``` use Hoa\Websocket\Server as WebsocketServer; use Hoa\Socket\Server as SocketServer; use Hoa\Event\Bucket; $subscribedTopics = array(); // ================================= $websocket_php = new WebsocketServer( new SocketServer('ws://127.0.0.1:8009') ); $websocket_php->on('open', function (Bucket $bucket)...
Any idea, why it is not working?
Well, problem next: **I saved bucket next:** ``` $subscribedTopics[substr($bucket->getSource()->getRequest()->getUrl(), 7)] = $bucket; ``` **And then, when I want to send:** ``` $subscribedTopics[$data['user']]->getSource()->send($data['command']); ``` if I will not put Socket\Node as...
> you didn't reach yet 10.000 items in the GC buffer, I try it with the GC: `gc_collect_cycles();` `meminfo_dump(fopen('/home/dmitriy/phpmem/my_dump_file_'.$i.'.json', 'w'));` Result is the same.