|
@ -57,12 +57,16 @@ var ioWatchers = new FreeList("iowatcher", 100, function () { |
|
|
|
|
|
|
|
|
IOWatcher.prototype.ondrain = function () { |
|
|
IOWatcher.prototype.ondrain = function () { |
|
|
assert(this.socket); |
|
|
assert(this.socket); |
|
|
if (this.writable || this.readable) { |
|
|
var socket = this.socket; |
|
|
require('timers').active(this.socket); |
|
|
|
|
|
this.socket.emit('drain'); |
|
|
if (socket.writable || socket.readable) { |
|
|
|
|
|
require('timers').active(socket); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.socket._eof) this.socket._shutdown(); |
|
|
socket.emit('drain'); |
|
|
|
|
|
if (socket.ondrain) socket.ondrain(); |
|
|
|
|
|
|
|
|
|
|
|
if (socket._eof) socket._shutdown(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|