We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77bb3c commit ac1f56cCopy full SHA for ac1f56c
1 file changed
lib/net.js
@@ -345,6 +345,12 @@ Socket.prototype._final = function(cb) {
345
return this.once('connect', () => this._final(cb));
346
}
347
348
+ // TODO(addaleax): This should not be necessary.
349
+ if (!this.readable || this._readableState.ended) {
350
+ cb();
351
+ return this.destroy();
352
+ }
353
+
354
if (!this._handle)
355
return cb();
356
0 commit comments