Ordering messages in socket.io

Does socket.io guarantee that on () calls will be called in the same order in which the messages were sent?

+6
source share
1 answer

Node.js is a single event loop, so yes.

But you have another problem, think about the delay between you and your clients, if two clients sent their messages, the first message arriving at the server will be processed first, therefore, if the first client issued its message, but it had a higher latency for the server from the second client (which sent its message after the first client), then this is probably the second client message that will be processed first

+6
source

All Articles