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

One to many broadcast? #11

Closed
lboogs99 opened this issue Nov 29, 2018 · 2 comments
Closed

One to many broadcast? #11

lboogs99 opened this issue Nov 29, 2018 · 2 comments

Comments

@lboogs99
Copy link

Hello all,

I've been looking at this project and it looks pretty stellar. One thing I am not seeing is a broadcast method, is there a method available to do a one to many broadcast? If not, any pointers or tips to build a method around this lib to achieve this?

Thanks!
L

@devMidgard
Copy link

I'm surprised nobody responded. Anyway this should be fairly easy. Just save each active websocket session into an array, iterate through it and send data to all :)

@ninjasource
Copy link
Owner

Hi L,

My apologies for not getting back to you all these months. This message slipped through the cracks! Like devMidgard said, sending the same message to an array of open web sockets would be the easiest way to do this. Although the websocket protocol is not bound to TCP/IP, it usually runs on top of it and TCP/IP is a point to point protocol. Indeed, when your browser initiates a websocket connection it begins with an HTTP request over TCP/IP.

However, I have run this websocket library over named pipes and other messaging technologies so you could probably use it over UDP (and leverage true broadcast capabilities) if you control both the client and the server.

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

3 participants