To send acknowledgement d=from server to client, we're going to add a third argument which is going to be a callback function. This function is going to fire when the acknowledgement arrives at the client, and we can do anything we like. For now we'll just print using console.log('Got it'):
socket.emit('createMessage', { from: 'Frank', text: 'Hi' }, function () { console.log('Got it'); });
Now this is all we need to do bare-bones style to add an acknowledgement to the client.