-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: emit close on unconnected socket #29803
Conversation
Socket should always emit 'close'. Regardless whether it has been connected or not.
39e179b
to
2b81112
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a minor fix for an edge case.
I agree.
} | ||
|
||
cb(exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this moving this into the individual branches of the if
matter, if emitCloseNT
is delayed by a tick anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax: yes, if the user inside the callback wants to schedule something before 'close'
using a nextTick
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm very close the edge on the edge case on this one :)
Socket should always emit 'close'. Regardless whether it has been connected or not. PR-URL: #29803 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Landed in a57da27 |
Socket should always emit 'close'. Regardless whether it has been connected or not. PR-URL: #29803 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Socket should always emit 'close'. Regardless whether it has been connected or not.
Probably a minor fix for an edge case.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes