I am emitting events in the following order:
Socket.emit('waiting','waiting for someone');
Socket.emit('found','found someone');
On the client side, I'm listening to events like this:
socket.on('waiting',function(data)
{
alert(data);
});
socket.on('found',function(data)
{
alert(data);
});
But yet for some reason, I see an alert for 'Found someone' before 'waiting for someone'. Although when I look at the console, the events seem to be emitted in the correct order. Anyone knows why this is happening?