账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    php swoole 服务端消息推送
    24
    0
    <?php
    namespace app\index\controller;
    
    class Pay {
      
        public function notice(){
            //想在这里通过websocket通知客户端支付成功 但是无法获取到 $server
        }
    } 

    swoole 只有在 获取到 $server 的时候才可以使用 $server->push();

    但是在想在服务端主动给客户端推送消息的时候没办法获取到 $server 这个咋解决呢?

    是需要用到 swoole websocket_client 去连接 websocket_server;
    利用 client 向 server send 数据 之后server再想客户端推送吗?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 共 0 条
    • 几孤风月 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部