Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Polling.prototype.write = function(packets){
var self = this;
this.writable = false;
var callbackfn = function() {
self.writable = true;
self.emit('drain');
};
var self = this;
parser.encodePayload(packets, this.supportsBinary, function(data) {
self.doWrite(data, callbackfn);
});
};
Polling.prototype.write = function(packets){
var self = this;
this.writable = false;
var callbackfn = function() {
self.writable = true;
self.emit('drain');
};
var self = this;
parser.encodePayload(packets, this.supportsBinary, function(data) {
self.doWrite(data, callbackfn);
});
};
Polling.prototype.send = function (packets) {
if (this.shouldClose) {
debug('appending close packet to payload');
packets.push({ type: 'close' });
this.shouldClose();
this.shouldClose = null;
}
var self = this;
parser.encodePayload(packets, this.supportsBinary, function(data) {
self.write(data);
});
};
Polling.prototype.send = function (packets) {
if (this.shouldClose) {
debug('appending close packet to payload');
packets.push({ type: 'close' });
this.shouldClose();
this.shouldClose = null;
}
var self = this;
parser.encodePayload(packets, this.supportsBinary, function(data) {
self.write(data);
});
};
Polling.prototype.send = function (packets) {
if (this.shouldClose) {
debug('appending close packet to payload');
packets.push({ type: 'close' });
this.shouldClose();
this.shouldClose = null;
}
var self = this;
parser.encodePayload(packets, this.supportsBinary, function(data) {
self.write(data);
});
};