Skip to content

Run forever socket close fix #1015

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

justmobilize
Copy link

In cases like handleDisconnect, the on_error callback is called first. If the WebSocketApp is being used in a multithreaded application, we nee to make sure that self.sock is cleared before calling close, otherwise logic built around the sock being set can cause issues - specifically calling run_forever again, since is checks if self.sock is set.

This was found when using the 3rd party library pysher that uses the websocket-client

As for example code, it isn't particularly easy. but if it's needed I'm sure I can put something together.

@justmobilize justmobilize marked this pull request as ready for review January 14, 2025 21:51
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.

1 participant