Ratchet
Ratchet copied to clipboard
Send message to a connection
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");
}
}
You have to know the target connection id, use it to get the target connection, and send, as your did in the last line.