-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
net: introduce Socket#connecting property
#6404
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| 'use strict'; | ||
| const common = require('../common'); | ||
| const assert = require('assert'); | ||
| const net = require('net'); | ||
|
|
||
| const server = net.createServer((conn) => { | ||
| conn.end(); | ||
| server.close(); | ||
| }).listen(common.PORT, () => { | ||
| const client = net.connect(common.PORT, () => { | ||
| assert.equal(client.connecting, false); | ||
|
||
|
|
||
| // Legacy getter | ||
| assert.equal(client._connecting, false); | ||
| client.end(); | ||
| }) | ||
|
||
| assert.equal(client.connecting, true); | ||
|
|
||
| // Legacy getter | ||
| assert.equal(client._connecting, true); | ||
| }); | ||
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.
should there be a deprecation message here?
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.
@ChALkeR Can you check how many people are using
._connectingin the wild?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.
@evanlucas it should be, will do it in a follow-up PR, because it won't be backported.