Socket.io emit() delay / buffer flush?
<p>I'm using <code>socket.io</code> to send messages to browser. On node.js side I'm doing</p>

<pre><code>socket.emit('message', data);
</code></pre>

<p>On browser-side I'm doing</p>

<pre><code>socket.on('message', handleData);
</code></pre>

<p>Now this works fine. For testing purposes I'm manually triggering (from node-inspector console) the <code>socket.emit()</code>. I'm able to do this 2-3 times after which the next message takes a long time to deliver. About 10 seconds.</p>

<p>My messages are rather short. Compression is enabled and the object JSON <code>{"could be about": "this long"}</code>. 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.</p>

<p>Does anyone have any insight into this delay? Thanks</p>