feature-check for bufferedAmount

This commit is contained in:
albertyfwu
2013-03-16 18:31:58 -04:00
parent 7d941af39b
commit e652ead78f

View File

@@ -89,7 +89,7 @@ WS.prototype.write = function(packets){
this.socket.send(parser.encodePayload(packets));
// check periodically if we're done sending
this.bufferedAmountId = this.setInterval(function() {
if (socket.bufferedAmount == 0) {
if ('bufferedAmount' in this.socket && this.socket.bufferedAmount == 0) {
clearInterval(self.bufferedAmountId);
this.writable = true;
this.emit('drain');