mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-03 12:17:48 +08:00
fix error example for broadcast in README.md
This commit is contained in:
parent
b4b7d17f30
commit
14087676a0
@ -115,7 +115,7 @@ function onConnect(\Hyperf\SocketIOServer\Socket $socket){
|
||||
$socket->emit('hello', 'can you hear me?', 1, 2, 'abc');
|
||||
|
||||
// sending to all clients except sender
|
||||
$socket->broadcast->emit('broadcast', 'hello friends!');
|
||||
$socket->broadcast(true)->emit('broadcast', 'hello friends!');
|
||||
|
||||
// sending to all clients in 'game' room except sender
|
||||
$socket->to('game')->emit('nice game', "let's play a game");
|
||||
|
Loading…
Reference in New Issue
Block a user