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.
return
_final
connecting
1 parent ae5739e commit a70ef63Copy full SHA for a70ef63
1 file changed
lib/net.js
@@ -529,10 +529,13 @@ Socket.prototype._unrefTimer = function _unrefTimer() {
529
// sent out to the other side.
530
Socket.prototype._final = function(cb) {
531
// If still connecting - defer handling `_final` until 'connect' will happen
532
- if (this.connecting && !this._finalizingOnConnect) {
+ if (this.connecting) {
533
debug('_final: not yet connected');
534
- this._finalizingOnConnect = true;
535
- return this.once('connect', () => this._final(cb));
+ if (!this._finalizingOnConnect) {
+ this._finalizingOnConnect = true;
536
+ this.once('connect', () => this._final(cb));
537
+ }
538
+ return;
539
}
540
541
if (!this._handle)
0 commit comments