You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But if I use express.io on the server side, the below code does not work because the callback is null.
express.io.route('data', function(req, callback) {
process data from client;
callback && callback(true); <--- This does not work because callback is undefined
}
So how do I do the callback to client side's emit on the server side using expressio?
The text was updated successfully, but these errors were encountered:
With pure socket io, I can pass callback to emit as follows:
server side:
socket.on('data', function(data, callback) {
process data from client;
callback && callback(true);
}
client side:
socket.emit('data', {name:value}, function(data) { console.log('The server got something'); }
But if I use express.io on the server side, the below code does not work because the callback is null.
express.io.route('data', function(req, callback) {
process data from client;
callback && callback(true); <--- This does not work because callback is undefined
}
So how do I do the callback to client side's emit on the server side using expressio?
The text was updated successfully, but these errors were encountered: