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

http listen method is possible to be called twice with no error #4646

Closed
ifraixedes opened this issue Jan 12, 2016 · 5 comments
Closed

http listen method is possible to be called twice with no error #4646

ifraixedes opened this issue Jan 12, 2016 · 5 comments
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@ifraixedes
Copy link

I've realised that if I create an http server and I call listen on the same port and hostname, several times, no error is reported on error event and the listen callback is called each time.

I've been surprised in finding this behaviour and I'm not sure if this is the expected one after I've tried to found this case in the docs; so I've opened this issue.

@mscdex mscdex added http Issues or PRs related to the http subsystem. question Issues that look for answers. labels Jan 12, 2016
@sam-github
Copy link
Contributor

Its not well doced, but you can reopen a server. Try with a different port, it should work, too.

@ifraixedes
Copy link
Author

No problem, as I said, it's something that I wasn't expected and it looked weird.
Should I send a PR adding the behavior in docs?

@jasnell
Copy link
Member

jasnell commented Jan 15, 2016

Adding documentation that explains that calling listen multiple times will reopen the server would be a good thing in my opinion. +1 :-) Thank you @ifraixedes for spotting that.

@jasnell
Copy link
Member

jasnell commented Jan 15, 2016

@nodejs/http

@jasnell
Copy link
Member

jasnell commented Apr 9, 2016

@nodejs/documentation

jasnell added a commit to jasnell/node that referenced this issue Aug 27, 2016
Fishrock123 pushed a commit to Fishrock123/node that referenced this issue Sep 8, 2016
Fixes: nodejs#4646
PR-URL: nodejs#8294
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Fishrock123 pushed a commit that referenced this issue Sep 9, 2016
Fixes: #4646
PR-URL: #8294
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@sam-github sam-github added doc Issues and PRs related to the documentations. and removed doc Issues and PRs related to the documentations. labels Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

4 participants