-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Socket.readyState is initially open #38247
Comments
Can confirm on master as well |
Per docs
#32272 mades |
@Ayase-252 If that's the raw definition of 'open' socket means then yes, but I don't think it's very intuitive IMO. |
Since this issue's been stale for a long time, and (even if not very intuitive) the behavior described is correct according to docs, I'll close this issue. If you experience this or similar issues feel free to reopen it or open a new one. |
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always. No.
What is the expected behavior?
net.Socket.readyState
should be initiallyclosed
like in the v12:What do you see instead?
net.Socket.readyState
isopen
after initialization, before any call toconnect()
:Additional information
This change made the Socket start as readable & writable: eeccd52
In v12 one could check if the socket is open by
socket.readyState === 'open'
In v14 another condition must be added
!socket.pending && socket.readyState === 'open'
The text was updated successfully, but these errors were encountered: