Skip to content

Commit

Permalink
Merge pull request socketio#332 from nkzawa/patch-0
Browse files Browse the repository at this point in the history
Fix wrong packet referring
  • Loading branch information
rauchg committed Jun 6, 2015
2 parents 1ecf02e + 30d9d7f commit 337c601
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/transports/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ WebSocket.prototype.onData = function (data) {

WebSocket.prototype.send = function (packets) {
var self = this;
for (var i = 0, l = packets.length; i < l; i++) {
var packet = packets[i];
packets.forEach(function(packet) {
parser.encodePacket(packet, this.supportsBinary, function(data) {
debug('writing "%s"', data);
self.writable = false;
Expand All @@ -95,7 +94,7 @@ WebSocket.prototype.send = function (packets) {
self.emit('drain');
});
});
}
});
};

/**
Expand Down

0 comments on commit 337c601

Please sign in to comment.