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

Close before the upgrade request is handled by the server #32

Closed
lpinca opened this issue Oct 23, 2014 · 6 comments
Closed

Close before the upgrade request is handled by the server #32

lpinca opened this issue Oct 23, 2014 · 6 comments

Comments

@lpinca
Copy link
Contributor

lpinca commented Oct 23, 2014

The server does not close cleanly if the client closes before the upgrade request is handled.
In this gist you can find a test case to reproduce the issue.
The close event is never emitted on the server and the process never exits.

The same example "works" when using einaros/ws and it seems that the edge case is handled here.

Thank you.

@jcoglan
Copy link
Collaborator

jcoglan commented Oct 26, 2014

Thanks for spotting this; it's fixed in 29d07c5.

@jcoglan jcoglan closed this as completed Oct 26, 2014
@lpinca
Copy link
Contributor Author

lpinca commented Oct 26, 2014

Awesome, thank you!
Can you release the fix on npm when you have time?

@lpinca
Copy link
Contributor Author

lpinca commented Nov 21, 2014

@jcoglan i was testing this and i noticed that the process exits, but the close event is not fired on the server. The close listener is never called.

@jcoglan
Copy link
Collaborator

jcoglan commented Nov 21, 2014

Surely that's down to Node? faye-websocket doesn't control which events the HttpServer emits.

@lpinca
Copy link
Contributor Author

lpinca commented Nov 21, 2014

@jcoglan I was thinking the same, wondering if it is an issue of the http.Server or it is intended.

@lpinca
Copy link
Contributor Author

lpinca commented Nov 24, 2014

I've created this issue nodejs/node-v0.x-archive#8763.
The problem seems to be caused by the fact that the stream is still writable on the server when the socket is destroyed. I still don't know why the process exits.

lpinca added a commit to lpinca/faye-websocket-node that referenced this issue Nov 25, 2014
lpinca added a commit to lpinca/faye-websocket-node that referenced this issue Nov 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants