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

Fix the echo server example to prevent ConnectionClosed error #189

Merged
merged 1 commit into from Sep 16, 2021
Merged

Fix the echo server example to prevent ConnectionClosed error #189

merged 1 commit into from Sep 16, 2021

Conversation

Leo1003
Copy link
Contributor

@Leo1003 Leo1003 commented Sep 10, 2021

Related #188

The echo server would generate ConnectionClosed error when the peer close the connection normally.

This is because that tungstenite crate automatically reply Close message to the peer.
Then StreamExt::forward() also forwards the Close message after the connection is closed.

Copy link
Contributor

@jxs jxs left a comment

Choose a reason for hiding this comment

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

thanks! Only some suggestion left

examples/echo-server.rs Outdated Show resolved Hide resolved
@Leo1003 Leo1003 requested a review from jxs September 13, 2021 12:36
examples/echo-server.rs Outdated Show resolved Hide resolved
Related #188

The echo server would generate ConnectionClosed error when the peer
close the connection normally. This is because that `tungstenite` crate
automatically reply Close message to the peer. Then StreamExt::forward()
also forwards the Close message after the connection is closed.
@Leo1003 Leo1003 marked this pull request as draft September 15, 2021 07:32
@Leo1003 Leo1003 marked this pull request as ready for review September 15, 2021 08:32
@daniel-abramov daniel-abramov merged commit 2bfd4cd into snapview:master Sep 16, 2021
@daniel-abramov
Copy link
Member

Thanks!

@Leo1003 Leo1003 deleted the fix-echo-server-example branch September 17, 2021 06:41
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.

None yet

3 participants