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

Make WebSocket#terminate() destroy the socket #1033

Merged
merged 1 commit into from
Mar 11, 2017
Merged

Make WebSocket#terminate() destroy the socket #1033

merged 1 commit into from
Mar 11, 2017

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Mar 6, 2017

Currently WebSocket.prototype.terminate() only sends a FIN packet to the other peer. If allowHalfOpen is true and the other peer does not call socket.end() the connection will only be closed when the timeout expires.

This patch makes WebSocket.prototype.terminate() use socket.destroy() so the connection is closed immediately even if the other peer fails to work properly.

Fixes #891.

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

Successfully merging this pull request may close these issues.

ws.terminate() fires the 'close' event 30 secs after termination?
1 participant