-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc issue: socket server 'error' event: 'close' is not called as described in doc. #9710
Comments
italoacasas
added
doc
Issues and PRs related to the documentations.
net
Issues and PRs related to the net subsystem.
labels
Nov 20, 2016
It may have just been copied from the |
@mscdex Is it ok to just remove everything except If yes I can prepare pull request. If no, I still can prepare pull request with something else :) |
@krydos no, i think the doc should insert a word "not"
=>
|
2 tasks
@krydos i'v made a pull request. |
2 tasks
jjqq2013
added a commit
to sjitech/node
that referenced
this issue
Feb 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am curious that should i call server.close in server.on('error'...) handler?
According to the document about net.Server 'error' event
But in fact, the 'close' event does not happen after error.
This is my
test.js
which try to listen a privileged port 80, cause an EACCESS error and exit.To ensure the close event can be caught before process exit, i set up a 1 second timer so process will keep alive in 1 second.
But still, the close event does not happen.
If i add
this.close()
in error handler, then the 'close' does happen.According to another doc about server.listen, obviously node.js does not call close on error, at least for EADDRINUSE.
So the document is contradictory, it should be noted that 'close' will not be called automatically.
Regards.
The text was updated successfully, but these errors were encountered: