hyperf / hyperf/socketio-server
服务端从容器中获取 SocketIO 单例, 然后 emit 推送消息给客户端,如果获取客户端收到消息后返回的 ack?
- Langage dominant
- PHP
- Étoiles
- 26
- Forks
- 6
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
如题,感谢。
比如业务上的一个控制器, 调用此控制器向特定的 客户端 发送消息
```php
class SendMessageController{
public function index(){
$socket = ApplicationContext::getContainer()->get(SocketIO::class);
$reply = $socket->to($client_id)->emit('some_event', '消息体')->reply(); // $reply is null ?
}
}
```
以上返回的 reply 为 null
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start with SendMessageController::index and the SocketIO instance obtained through ApplicationContext::getContainer(); trace the to($client_id)->emit('some_event', '消息体')->reply() chain and how client acknowledgements are handled. Done means establishing whether this server-side call can receive the client's ack and defining the expected non-null reply behavior.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- php
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100