You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
http listen method is possible to be called twice with no error #4646
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.
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.
Activity
sam-github commentedon Jan 14, 2016
Its not well doced, but you can reopen a server. Try with a different port, it should work, too.
ifraixedes commentedon Jan 15, 2016
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 commentedon Jan 15, 2016
Adding documentation that explains that calling
listenmultiple times will reopen the server would be a good thing in my opinion. +1 :-) Thank you @ifraixedes for spotting that.jasnell commentedon Jan 15, 2016
@nodejs/http
jasnell commentedon Apr 9, 2016
@nodejs/documentation
doc: document what happens when listen is called multiple times
doc: doc that listen can be called multiple times
doc: doc that listen can be called multiple times
doc: doc that listen can be called multiple times