Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed callback function to have arguments of packet, index, total i…

…nstead of packet, isDone
  • Loading branch information...
commit 1c54df627b9fcf0fecf1c2e186e57c70edb3893f 1 parent 4801248
@albertyfwu albertyfwu authored
Showing with 18 additions and 6 deletions.
  1. +9 −3 engine.io.js
  2. +9 −3 lib/transports/polling.js
View
12 engine.io.js
@@ -1869,11 +1869,17 @@ Polling.prototype.onData = function(data){
var self = this;
debug('polling got data %s', data);
// decode payload
- parser.decodePayload(data, function(packet, isDone) {self.onDataCallback(packet, isDone)});
+ parser.decodePayload(data, function(packet, index, total) {self.onDataCallback(packet, index, total)});
};
-Polling.prototype.onDataCallback = function(packet, isDone){
- // if its the first message we consider the trnasport open
+/**
+ * Callback function for payloads
+ *
+ * @api private
+ */
+
+Polling.prototype.onDataCallback = function(packet, index, total){
+ // if its the first message we consider the transport open
if ('opening' == this.readyState) {
this.onOpen();
}
View
12 lib/transports/polling.js
@@ -120,11 +120,17 @@ Polling.prototype.onData = function(data){
var self = this;
debug('polling got data %s', data);
// decode payload
- parser.decodePayload(data, function(packet, isDone) {self.onDataCallback(packet, isDone)});
+ parser.decodePayload(data, function(packet, index, total) {self.onDataCallback(packet, index, total)});
};
-Polling.prototype.onDataCallback = function(packet, isDone){
- // if its the first message we consider the trnasport open
+/**
+ * Callback function for payloads
+ *
+ * @api private
+ */
+
+Polling.prototype.onDataCallback = function(packet, index, total){
+ // if its the first message we consider the transport open
if ('opening' == this.readyState) {
this.onOpen();
}
Please sign in to comment.
Something went wrong with that request. Please try again.