Server-initiated broadcast

33 views
Skip to first unread message

Amir Eldor

unread,
Sep 4, 2016, 7:34:29 AM9/4/16
to sockjs
In the different SockJS examples for a client to notify all other clients of something, the client uses its 'broadcast' method.
For example, inside an on_data (just an example name, forget about correct naming for now) or similar callback, client calls 'broadcast'.

What happens if my server wants to initiate such a broadcast?

What I tried is to keep a list of all my connections and pass it so some other function in my code, and then that code selects one connection randomly and uses its 'broadcast'.
I did that on a sockjs-tornado test-app.

Is this sane? I think I'm missing something.

Thanks.
Reply all
Reply to author
Forward
0 new messages