1.hhxsv5/laravel-s适配器github地址:
2.主要代码
/**@var SwooleHttpServer|SwooleWebSocketServer $swoole */$swoole = app('swoole');// $swoole->ports:遍历所有Port对象,=ports$port = $swoole->ports[1]; // 获得`SwooleServerPort`对象,$port[0]是主服务器的端口foreach ($port->connections as $fd) { // 遍历所有连接// $swoole->send($fd, 'Send tcp message');// if($swoole->isEstablished($fd)) {// $swoole->push($fd, 'Send websocket message');// }}
3.说明
本文发布于:2024-01-30 15:44:15,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170660066121079.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |