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

Emit a socket closed event in a non-async socket loop #67

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

SuperDisk
Copy link
Contributor

@SuperDisk SuperDisk commented Jul 8, 2024

Normally when using an async web server, websocket-driver handles broken connections by attempting to write to a stream, and if that fails, it closes the socket and emits the close event. In the case of a non-async webserver like Hunchentoot, a loop form checks the stream's status manually, and then closes the socket once the loop exits. But in that case, it doesn't emit the close event. This PR adds emitting the :close event after the loop terminates.

Normally when using an async web server, websocket-driver handles broken
connections by attempting to write to a stream, and if that fails, it
closes the socket and emits the close event. In the case of a non-async
webserver like Hunchentoot, a loop form checks the stream's status
manually, and then closes the socket once the loop exits. But in this
case, it doesn't emit the close event. This PR adds the event to this
case as well.
@SuperDisk
Copy link
Contributor Author

It's possible that this might fix #62 and #59.

@fukamachi fukamachi merged commit 17ba553 into fukamachi:master Jul 9, 2024
@fukamachi
Copy link
Owner

Thanks!

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