I did not find it explicitly in the RFC.
Is the order of operations guaranteed?
In other words
if clients do
// first op - client 1
.send(1)
// second op - client 2
.send(2)
then the receiver always receives
2
and never
1
Could you confirm it?
TCP itself offers in-order, exactly-once delivery guarantee so yes WS also does by extension. HTTP doesn't provide this guarantee because HTTP requests may be spread over multiple TCP connections (and this negates the guarantee). Since a WebSocket uses a single TCP connection, this guarantee is maintained.
@jondubois :+1: nicely said– thanks.
Most helpful comment
TCP itself offers in-order, exactly-once delivery guarantee so yes WS also does by extension. HTTP doesn't provide this guarantee because HTTP requests may be spread over multiple TCP connections (and this negates the guarantee). Since a WebSocket uses a single TCP connection, this guarantee is maintained.