socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

network performance: "broadcast" vs. "iterating over clients and send".

Open dasdeck opened this issue 12 years ago • 3 comments

hi. i suppose my question (i hope this is the right place for questions) is more a general questions about sockets. when i think of broadcasting messages, i could imagine that this process could be greatly optimized by sending the message only once to multiple recipients (so to speak), as opposed to sending the message to each client separately. i have no idea wether this (or what else) is actually happening at the tcp layer(or any other layer low enough for such operations). so my question is if its actually makes a difference network performance wise if i use a broadcast or if i iterate through my clients and send my data directly. i want to send specific data selectively (like with using socket.io's rooms) to free clients who don't need the data form having to process it (wich could ultimately be decided in the client) and most of all to save network bandwidth.

again, i hope this is the right place for such questions, and if not i hope you can kindly point me to such a place :)

thanks in advance :)

jm

dasdeck avatar Dec 21 '13 10:12 dasdeck

+1 for this question

lytespark avatar Dec 25 '13 20:12 lytespark

+1 for this question

crzidea avatar Dec 26 '13 02:12 crzidea

to be realistic: for me it is no difference between broadcasting to all users or sending data by iterating over all users in a room...

my solution is to send data individual to specific users. so i can save bandwidth and the logic is on the server, not in the client.

fenta23 avatar Apr 10 '14 12:04 fenta23