Ratchet icon indicating copy to clipboard operation
Ratchet copied to clipboard

Send message to a connection

Open raphaelvserafim opened this issue 2 years ago • 1 comments

how to send a message to a specific connection?

                 for ($j = 0; sizeof($this->conexao_atendentes[$i]["setor"]) > $j; $j++) {
                            if ($setor == $this->conexao_atendentes[$i]["setor"][$j]) {

                                 echo  "Enviar para " . $this->conexao_atendentes[$i]["conn"] . " \n";

                                 $this->clients[$this->conexao_atendentes[$i]["conn"]]->send("Oie");
                            }
                        }

raphaelvserafim avatar Jun 23 '22 14:06 raphaelvserafim

You have to know the target connection id, use it to get the target connection, and send, as your did in the last line.

FeIix avatar Dec 05 '22 12:12 FeIix