Skip to content
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: remove net.Socket.prototype.listen #13735

Closed
wants to merge 1 commit into from

Conversation

BridgeAR
Copy link
Member

@BridgeAR BridgeAR commented Jun 17, 2017

I suggest to deprecate this function. It was never documented even though it was already added in 2011. I am not sure what it was for and maybe @bnoordhuis might have a look as a original reviewer?
The function is defunct and shout simply be removed. As it was never documented there should not be a problem about it.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

net

@nodejs-github-bot nodejs-github-bot added the net Issues and PRs related to the net subsystem. label Jun 17, 2017
@mscdex mscdex added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jun 17, 2017
lib/net.js Outdated
debug('socket.listen');
this.on('connection', arguments[0]);
listenInCluster(this, null, null, null);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the extra indentation, and change this line to:

}, 'Socket.prototype.listen() is deprecated.', 'DEP0073');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation code should be DEP00XX... the actual value would be assigned when the PR lands

@jasnell
Copy link
Member

jasnell commented Jun 19, 2017

Ping @ChALkeR ... is it possible to get some idea of how much this is used?

@bnoordhuis
Copy link
Member

Not opposed but it's neither broken nor a maintenance hassle, just a wart.

@BridgeAR
Copy link
Member Author

@bnoordhuis would you recommend to document this part instead of deprecating it? Because I think the current situation should be changed one way or the other.

@BridgeAR
Copy link
Member Author

PTAL

@cjihrig
Copy link
Contributor

cjihrig commented Jun 23, 2017

@ChALkeR ChALkeR self-assigned this Jun 24, 2017
@BridgeAR
Copy link
Member Author

@cjihrig sorry, I didn't address the comment right away because I thought there might be feedback to my question. I fixed that now though.

@@ -630,6 +630,14 @@ Type: Runtime

*Note*: change was made while `async_hooks` was an experimental API.

<a id="DEP0073"></a>
### DEP0073: net.Socket.prototype.listen()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecation code here should be DEP00XX. The actual number should be assigned when the PR lands.

@BridgeAR
Copy link
Member Author

Comment addressed and rebased

@BridgeAR
Copy link
Member Author

PTAL - we might also still just go ahead and document this instead of deprecating it.
(I will rebase as soon as there is a conclusion)

@jasnell
Copy link
Member

jasnell commented Aug 25, 2017

@BridgeAR ... that would be my preference.

@BridgeAR
Copy link
Member Author

BridgeAR commented Dec 6, 2017

I am closing this as I do not really know how to document this as I do not know what it should be used for.

If someone knows more, please let me know and I will have a look at it again.

@BridgeAR BridgeAR closed this Dec 6, 2017
@bnoordhuis
Copy link
Member

@BridgeAR The idea is that net.Socket#listen() enables process.stdin.listen(), which at one time was necessary to make FastCGI work.

Looking at the code again, I'm pretty sure it's broken (as in: unusable, throws TypeErrors) and has been for a long time so there is no point in deprecating it. It can be removed outright.

@BridgeAR
Copy link
Member Author

BridgeAR commented Dec 6, 2017

@bnoordhuis thanks a lot for the info! And yes, I just checked and the function would simple throw a TypeError when called. Removing seems to be the right thing to do here.

The function was never documented and now throws a TypeError if used.
@BridgeAR BridgeAR changed the title net: deprecate net.Socket.prototype.listen net: remove net.Socket.prototype.listen Dec 6, 2017
@apapirovski
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/12009/

I've also removed the semver-major label as this method doesn't even work.

@apapirovski apapirovski removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 9, 2017
@apapirovski apapirovski added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 9, 2017
BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 12, 2017
The function was never documented and now throws a TypeError if used.

PR-URL: nodejs#13735
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@BridgeAR
Copy link
Member Author

Landed in e17dba7

@BridgeAR BridgeAR closed this Dec 12, 2017
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 13, 2017
MylesBorins pushed a commit that referenced this pull request Dec 20, 2017
The function was never documented and now throws a TypeError if used.

PR-URL: #13735
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2017
The function was never documented and now throws a TypeError if used.

PR-URL: #13735
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
MylesBorins added a commit that referenced this pull request Jan 10, 2018
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069
MylesBorins added a commit that referenced this pull request Jan 10, 2018
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069
MylesBorins added a commit that referenced this pull request Jan 10, 2018
Notable change:

* async_hooks:
  - deprecate AsyncHooks Sensitive API and runInAsyncIdScope. Neither
    API were documented. (Andreas Madsen)
    #16972
* deps:
  - update nghttp2 to 1.29.0 (James M Snell)
    #17908
  - upgrade npm to 5.6.0 (Kat Marchán)
    #17535
  - cherry-pick 50f7455 from upstream V8 (Michaël Zasso)
    #16591
* events:
  - remove reaches into _events internals (Anatoli Papirovski)
    #17440
* http:
  - add rawPacket in err of `clientError` event (XadillaX)
    #17672
* http2:
  - implement maxSessionMemory (James M Snell)
    #17967
  - add initial support for originSet (James M Snell)
    #17935
  - add altsvc support (James M Snell)
    #17917
  - perf_hooks integration (James M Snell)
    #17906
  - Refactoring and cleanup of Http2Session and Http2Stream destroy
    (James M Snell) #17406
* net:
  - remove Socket.prototype.write (Anna Henningsen)
    #17644
  - remove Socket.prototype.listen (Ruben Bridgewater)
    #13735
* repl:
  - show lexically scoped vars in tab completion (Michaël Zasso)
    #16591
* stream:
  - rm {writeable/readable}State.length (Calvin Metcalf)
    #12857
  - add flow and buffer properties to streams (Calvin Metcalf)
    #12855
* util:
  - allow wildcards in NODE_DEBUG variable (Tyler)
    #17609
* zlib:
  - add ArrayBuffer support (Jem Bezooyen)
    #16042
* Addedew collaborator**
  - [starkwang](https://github.com/starkwang) Weijia Wang
* Addedew TSC member**
  - [danbev](https://github.com/danbev) Daniel Bevenius

PR-URL: #18069
@MylesBorins
Copy link
Contributor

Didn't land on v6.x, should it be considered for v8.x?

@MylesBorins
Copy link
Contributor

Should this be backported to v8.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.