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 - document upgrade error handling #15360

Closed
ronag opened this issue Sep 12, 2017 · 2 comments
Closed

http - document upgrade error handling #15360

ronag opened this issue Sep 12, 2017 · 2 comments
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@ronag
Copy link
Member

ronag commented Sep 12, 2017

Looking at https://nodejs.org/api/http.html#http_event_upgrade and https://nodejs.org/api/http.html#http_event_upgrade_1 it's unclear whether I have to listen to both res.on('error', ...) and socket.on('error', ...).

Is there any overlap between them? i.e. can an error be emitted to both, are there errors that are not emitted by both? A little bit of set theory.

@benjamingr benjamingr added http Issues or PRs related to the http subsystem. question Issues that look for answers. labels Sep 12, 2017
@lpinca
Copy link
Member

lpinca commented Sep 17, 2017

The tcp socket is freed when the 'upgrade' event is emitted. Errors are only emitted to the socket instance.

@lpinca
Copy link
Member

lpinca commented Sep 21, 2017

@ronag is your question answered? Can this be closed?

@ronag ronag closed this as completed Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

3 participants