Php swoole server message push

<?php
namespace app\index\controller;

class Pay {
  
    public function notice(){
        //websocket  $server
    }
} 

swoole can use $server- > push () ;

only if you get $server .

but how to solve this problem when you can"t get $server when you want to push messages to the client on the server?

is it necessary to use swoole websocket_client to connect websocket_server ;
use client to server send data before server wants to push to the client?

Apr.25,2022

you can get the server.
list as follows:

  

about swoole actively sending messages to the client client- > server, how to realize the websocket client asynchronism can only be used in cli mode, and how to implement fpm, ask the boss to tell me!!

Menu