It seems that you forgot to call the callback on the server code:
var io = require('socket.io')(80); io.on('connection', function (socket) { socket.on('sendMessage', function (data, callback) { console.log('Message received:', data); callback('Message successfully delivered to server!'); }); });
Check this stream or docs for more information.
EDIT:
The problem also is that the Ack implementation should run as the last emit parameter, so your Java code should look like this:
socket.emit("sendMessage", "Hi!! how are you", new Ack() { @Override public void call(Object... args) { System.out.println("sendMessage IOAcknowledge" + args.toString()); } });
source share