简体   繁体   English

如何在节点 js 中使用 socket.io 和 android 向特定在线用户广播消息

[英]How to broadcast a message to particular online users with socket.io in node js and android

I have a server in which there are many users who know different subjects.我有一个服务器,其中有许多了解不同主题的用户。 I want to broadcast a message to only first 5 maths teachers that "you are a maths teacher".我想只向前 5 位数学老师广播“你是数学老师”的消息。 How to do that with socket.io.如何使用 socket.io 做到这一点。

I have a emit a message on a particular subject "maths" but its going to all maths teachers.我有一个关于特定主题“数学”的消息,但它会发送给所有数学老师。

If I send to them by creating a unique Id with those 5 maths teachers, the how will Front End will get to know on which event should we recieve that message.如果我通过与这 5 位数学老师创建一个唯一的 ID 发送给他们,前端将如何知道我们应该在哪个事件中收到该消息。

I have a server in which there are many users who know different subjects.我有一个服务器,其中有许多了解不同主题的用户。 I want to broadcast a message to only first 5 maths teachers that "you are a maths teacher".我想只向前 5 位数学老师广播“你是数学老师”的消息。 How to do that with socket.io.如何使用 socket.io 做到这一点。

I have a emit a message on a particular subject "maths" but its going to all maths teachers.我有一个关于特定主题“数学”的消息,但它会发送给所有数学老师。

If I send to them by creating a unique Id with those 5 maths teachers, the how will Front End will get to know on which event should we recieve that message.如果我通过与这 5 位数学老师创建一个唯一的 ID 发送给他们,前端将如何知道我们应该在哪个事件中收到该消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM