Ratchet + ZMQ private messages!

81 views
Skip to first unread message

off...@attractionclub.ro

unread,
Apr 27, 2015, 9:30:50 AM4/27/15
to ratch...@googlegroups.com
Hello, I use http://socketo.me/docs/push example! everything works perfect I already have 10 topics on my website...
Like ! Live updating online users, notifications etc...and now I wan't to extend the application ! And the next goal is to make a Instant Messagin Application with websockets!

The question is! How do I send one message to a specific user! My code for pull function is  : 

$entryData = json_decode($entry, true);
// If the lookup topic object isn't set there is no one to publish to
if (!array_key_exists($entryData['category'], $this->subscribedTopics))
{
return;
}
$topic = $this->subscribedTopics[$entryData['category']];
// re-send the data to all the clients subscribed to that category
$topic->broadcast($entryData);

cboden

unread,
May 16, 2015, 12:25:31 AM5/16/15
to ratch...@googlegroups.com, off...@attractionclub.ro
To send a message to an individual user instead of everyone in a topic you can use $conn->send($myMessage);
Reply all
Reply to author
Forward
0 new messages