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

Return Error::Finished in recv() on graceful close. #351

Merged
merged 4 commits into from
Jun 12, 2020

Conversation

Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Jun 11, 2020

This PR depends on #350.

This allows applications to distinguish whether the remote end has
gracefully closed the connection with a FIN (in which case it has
received all the data intact), or the connection has failed due to e.g. a
RST or a timeout (in which case the received data may be truncated).

Fixes #349

whitequark
whitequark previously approved these changes Jun 11, 2020
Copy link
Contributor

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

LGTM

Dirbaio added 3 commits June 11, 2020 22:25
This allows applications to distinguish whether the remote end has
gracefully closed the connection with a FIN (in which case it has
received all the data intact), or the connection has failed due to e.g. a
RST or a timeout (in which case the received data may be truncated).
@Dirbaio
Copy link
Member Author

Dirbaio commented Jun 11, 2020

Added documentation and rebased.

@whitequark whitequark merged commit 82a1c97 into smoltcp-rs:master Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

How to distinguish FIN and RST closes in recv?
2 participants