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

Server should check socket state before calling 'send' method #44

Closed
coderNeos opened this issue Aug 8, 2019 · 8 comments
Closed

Server should check socket state before calling 'send' method #44

coderNeos opened this issue Aug 8, 2019 · 8 comments

Comments

@coderNeos
Copy link

return socket.send(CircularJSON.stringify(response), msg_options)

In case if client socket closes the connection - 'send' will cause an unhandled rejection, which in some production environments might lead to application crash!

Mentioned problem is relevant to any other socket.send call.

Steps to reproduce:

  1. Call some long running rpc task
  2. Close client connection
  3. After task has finished - unhandledRejection will be triggered
@mkozjak
Copy link
Member

mkozjak commented Aug 8, 2019

Hi, @coderNeos! Thanks for reporting! Care to do a PR?

@coderNeos
Copy link
Author

Hi, i think i will be able to fix that issue in my free time.

@mkozjak
Copy link
Member

mkozjak commented Aug 8, 2019

Thank you so much!

@lucaswxp
Copy link

Anyone got this?

@coderNeos
Copy link
Author

Anyone got this?

Nope, i didn't have any spare time to address this issue

@mkozjak
Copy link
Member

mkozjak commented Nov 14, 2019

@lucaswxp: Wanna try providing a PR?

@mkozjak
Copy link
Member

mkozjak commented Aug 5, 2020

@coderNeos any updates on this one maybe?

@mkozjak
Copy link
Member

mkozjak commented Aug 26, 2020

websockets/ws#1532

@mkozjak mkozjak closed this as completed in 5c07b21 Sep 6, 2020
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

3 participants