Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I broadcast to all WebSocket clients

I'm assuming this isn't possible, but wanted to ask in case it is. If I want to provide a status information web page, I want to use WebSockets to push the data from the server to the browser. But my concerns are the effect a large number of browsers will have on the server. Can I broadcast to all clients rather than send discrete messages to each client?

like image 403
Bernhard Hofmann Avatar asked Jul 01 '10 06:07

Bernhard Hofmann


People also ask

Does WebSocket send to all clients?

A server can open WebSocket connections with multiple clients—even multiple connections with the same client. It can then message one, some, or all of these clients.

How do you emit to all clients in socket IO?

To broadcast an event to all the clients, we can use the io. sockets. emit method. Note − This will emit the event to ALL the connected clients (event the socket that might have fired this event).

How many clients can WebSocket handle?

By default, a single server can handle 65,536 socket connections just because it's the max number of TCP ports available.

Are WebSockets full duplex?

WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011. The current API specification allowing web applications to use this protocol is known as WebSockets.


1 Answers

WebSockets uses TCP, which is point to point, and provides no broadcast support.

like image 189
nos Avatar answered Sep 23 '22 03:09

nos