-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sentToUid和sendToClient推送失败 #14
Comments
debug方式运行(php start.php start),看看有没有什么报错。 |
没有报错哈,debug模式下运行过 |
可能是参数传错了,打下日志看看吧。client_id是否对。 |
日志没有报错哈,Gateway::sendToClient($client_id, json_encode(["type" => "message", 'content' => $msg->content])); Gateway::sendToAll(json_encode(["type" => "message", "clientId" => $client_id, 'content' => $msg->content])); 第一个收不到,第二个能收到,那我先试试workerman-chat |
$client_id直接用的客户端上报的那个参数,public static function onMessage($client_id, $message) { |
已解决,registerAddress端口没有统一设置成1236,自己给自己挖了个坑,谢了 |
冒昧的请教下:在使用GatewayWorker的时候(websocket),在events.php文件onMessage函数里面使用sendToAll能推送给客户端成功接收,但是使用sendToUid和sendToClient给指定客户端推送消息,可能是什么原因呢?
The text was updated successfully, but these errors were encountered: