Reintroduce writeRaw

This commit is contained in:
roblabla 2015-05-22 19:22:21 +00:00
parent 6e6b51ca10
commit f5dda55f81

View File

@ -179,22 +179,9 @@ Client.prototype.write = function(packetId, params, cb = noop) {
this.serializer.write({ packetId, params }, cb); this.serializer.write({ packetId, params }, cb);
}; };
// TODO : Write to the correct stream. This is currently broken.
Client.prototype.writeRaw = function(buffer) { Client.prototype.writeRaw = function(buffer) {
/*var self = this; if (this.compressor === null)
this.framer.write(buffer);
var finishWriting = function(error, buffer) { else
if(error) this.compressor.write(buffer);
throw error; // TODO : How do we handle this error ?
var out = self.encryptionEnabled ? new Buffer(self.cipher.update(buffer), 'binary') : buffer;
self.socket.write(out);
};
if(this.compressionThreshold >= 0 && buffer.length >= this.compressionThreshold) {
compressPacketBuffer(buffer, finishWriting);
} else if(this.compressionThreshold >= -1) {
newStylePacket(buffer, 0, finishWriting);
} else {
oldStylePacket(buffer, finishWriting);
}*/
throw new Error("Pending refactorisation");
}; };