diff --git a/lib/net.js b/lib/net.js index cb8e25ed60..4467654802 100644 --- a/lib/net.js +++ b/lib/net.js @@ -399,6 +399,12 @@ Socket.prototype.write = function(data, arg1, arg2) { return false; } + return this._write(data, encoding, cb); +}; + + +Socket.prototype._write = function(data, encoding, cb) { + // `encoding` is unused right now, `data` is always a buffer. var writeReq = this._handle.write(data); if (!writeReq) { @@ -557,7 +563,7 @@ function afterConnect(status, handle, req) { if (self._connectQueue) { debug('Drain the connect queue'); for (var i = 0; i < self._connectQueue.length; i++) { - self.write.apply(self, self._connectQueue[i]); + self._write.apply(self, self._connectQueue[i]); } self._connectQueueCleanUp(); }