Michele Tuloski Furci
Michele Tuloski Furci

Reputation: 71

Server broadcasting to multiple websockets. Some are faster?

When a server broadcast the same info to multiple clients via websocket connection my idea is that some clients will receive the information faster (supposing the transmit time is the same for all clients) because after all the data going out the server is "serial".

Or is there something I'm missing? Can it be dependent on the implementation of the ws broadcast?

How can for example FOREX server be sure that all the clients receive the information about exchanges done at the same time?

Upvotes: 0

Views: 242

Answers (1)

Myst
Myst

Reputation: 19221

There's never a guaranteed way that all the clients will receive the data at the same time.

Even if the data was sent at the same time (for example, using UDP broadcasting rather than a WebSocket connection), clients suffer from different network latency and routing, the data will still arrive at different times.

For WebSockets, the server itself will always send the data to some clients before it's sent to other clients...

...but this doesn't mean the data will arrive in the same order. Network latency, connectivity issues, intermediary performance and other uncontrollable concerns might make it so the data that was sent first arrives last. It's impossible to control.

Upvotes: 1

Related Questions