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

Invoke the close callback when the close event is emitted #892

Merged
merged 1 commit into from
Nov 15, 2016

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Nov 15, 2016

Right now the close callback is invoked immediately but it should be called when the HTTP server emits the 'close' event.

error = e;
}
}
for (const client of this.clients) client.terminate();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the try...catch statement because WebSocket.prototype.terminate() does not throw errors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But doesn't the underlaying node code could be throwing errors.

@3rd-Eden
Copy link
Member

nvm, all those other functions are already wrapping all socket calls in try { } catch () {}

@3rd-Eden 3rd-Eden merged commit 490d921 into master Nov 15, 2016
@3rd-Eden 3rd-Eden deleted the fix/close-callback branch November 15, 2016 17:00
@lpinca lpinca mentioned this pull request Dec 12, 2016
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.

2 participants