diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2015-03-22 14:28:27 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2015-03-24 14:09:16 -0700 |
commit | 13f2e7c1177992566b1ec9d0313813da80953ce9 (patch) | |
tree | 42ec7595e83f9d2e0b6b092944e102469a7c0c81 | |
parent | f201331754d2620cf1770acc8b327d7d9a157333 (diff) | |
download | node-13f2e7c1177992566b1ec9d0313813da80953ce9.tar.gz |
net: reinitialize duplex on reconnect
-rw-r--r-- | lib/net.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/net.js b/lib/net.js index 3067dc108..48be0acd7 100644 --- a/lib/net.js +++ b/lib/net.js @@ -148,6 +148,7 @@ function Socket(options) { else if (util.isUndefined(options)) options = {}; + this._originalOptions = options; stream.Duplex.call(this, options); if (options.handle) { @@ -891,13 +892,7 @@ Socket.prototype.connect = function(options, cb) { // XXX this logic is suspect if (this.destroyed) { - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; + stream.Duplex.call(this, this._originalOptions); this.destroyed = false; this._handle = null; this._strictEvents = {}; |