Fixes event type when emitting binary_ack

When submitting binary data in an Ack to the server the packet's type
was not the expected (should be 6 - binary_ack - and not 3 - ack).

This commit introduces tests as well a fix for the given problem.
This commit is contained in:
Ciro S. Costa
2016-01-27 12:11:22 -03:00
parent 9ed41954ae
commit f0832ffc61
3 changed files with 76 additions and 1 deletions

View File

@@ -57,6 +57,17 @@ io.of(nsp).on('connection', function(socket) {
});
});
socket.on('callAckBinary', function() {
socket.emit('ack', function(buf) {
socket.emit('ackBack', buf);
});
});
socket.on('getAckBinary', function(data, callback) {
var buf = new Buffer('huehue', 'utf8');
callback(buf);
});
socket.on('getAckDate', function(data, callback) {
callback(new Date());
});