How to call acknowledgment functions in SocketIO? : <p>Following the documentation on the <a href="https://socket.io/docs/" rel="noreferrer">SocketIO website</a>, I have the following code:</p>

<p><strong>Server</strong></p>

<pre><code>socket.on('foo', (arg, ack) =&gt; {
    //Do stuff with arg
    if(ack)
        ack('response');
});
</code></pre>

<p><strong>Client</strong></p>

<pre><code>socket.emit('foo', arg, (response) =&gt; {
    console.log(response);
});
</code></pre>

<p>However, the <code>ack</code> function is never called. As a matter of fact, it is <code>undefined</code>. I am using SocketIO v2.0.4 on both server and client side.</p>

<p>Am I missing something? The docs make it look like it should be that easy, yet I just can't figure it out!</p>

<p>Thanks!</p>
