There's more...

Sending the same message or data, to more than one client, is called broadcasting. The method we have seen broadcasts a message to all clients, including the client that generated the request.

There are other several methods to broadcast a message. For instance:

socket.to('commonRoom').emit('updateClientCount', data) 

Which will emit an updateClientCount event to all clients in commonRoom expect to the sender or the socket that originated the request.

For a complete list check the official documentation of Socket.IO emit cheatsheet: https://socket.io/docs/emit-cheatsheet/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.137.108