我正在使用GosWebSocketBundle(https://github.com/GeniusesOfSymfony/WebSocketBundle)发送通知/消息。我已经将文档转至公共频道的所有订户并处理了广播消息。但是我不希望发件人收到它自己的消息。请帮助我。
public function onSubscribe(ConnectionInterface $connection, Topic $topic, WampRequest $request)
{
//this will broadcast the message to ALL subscribers of this topic.
$topic->broadcast(['msg' => $connection->resourceId . " has joined " . $topic->getId()]);
}
public function onPublish(ConnectionInterface $connection, Topic $topic, WampRequest $request, $event, array $exclude, array $eligible)
{
$topic->broadcast(['msg' => $event]);
}