Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I broadcast a message to all connected clients? #3

Open
rovico opened this issue Mar 14, 2018 · 0 comments
Open

How can I broadcast a message to all connected clients? #3

rovico opened this issue Mar 14, 2018 · 0 comments

Comments

@rovico
Copy link

rovico commented Mar 14, 2018

Hi!

I am newbie in websockets and swoole, herefore I understand, that i may do something wrong.
I have a project, where i need to send push messages to all connected websocket clients, for example i need to notify all users that there is new messages or tasks for them.

I expected to get list of all connected clients and then run through that list and send push to each fd... But I cannot do this direct, because server starts in SwooleService. Than i thought, that i need to create a task, that will run cli action, that will send pushes.... I created a mongoDb task and it runs my action, but i still can't get server instance to list clients....

My question is How can I broadcast a message to all connected clients?

Please, Help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant