I'm using socket.io
to send messages to browser. On node.js side I'm doing
socket.emit('message', data);
On browser-side I'm doing
socket.on('message', handleData);
Now this works fine. For testing purposes I'm manually triggering (from node-inspector console) the socket.emit()
. I'm able to do this 2-3 times after which the next message takes a long time to deliver. About 10 seconds.
My messages are rather short. Compression is enabled and the object JSON {"could be about": "this long"}
. When testing with longer strings, all messages are sent instantly. So this has something to do with buffering/optimization, but in our case, it's important that all messages are sent instantly.
Does anyone have any insight into this delay? Thanks