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

Stream Stop Read/Write #127

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Stream Stop Read/Write #127

wants to merge 2 commits into from

Conversation

dr7ana
Copy link
Collaborator

@dr7ana dr7ana commented May 7, 2024

No description provided.

@dr7ana dr7ana enabled auto-merge May 7, 2024 22:19
Copy link
Member

@jagerman jagerman left a comment

Choose a reason for hiding this comment

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

Left some comments in the PR.

A couple other things are needed here as well:

  1. Attempting to append stream data to a stream that has writing shut down should warn and drop the data, rather than making new buffers for it and storing it.

  2. A callback mechanism is needed for an application to know when the stream has entered non-read or non-write state as a result of the other side's actions. For instance, embedded lokinet's tunneled quic streams are going to need to make the appropriate shutdown call in response to the other side shutting down one direction of the stream.

tests/012-stream_signalling.cpp Outdated Show resolved Hide resolved
tests/012-stream_signalling.cpp Show resolved Hide resolved
src/stream.cpp Outdated Show resolved Hide resolved
src/stream.cpp Show resolved Hide resolved
@dr7ana
Copy link
Collaborator Author

dr7ana commented May 8, 2024

@jagerman thanks for the feedback, changes made!

- Applications can call `::set_remote_reset_hooks(...)` to emplace logic to be executed when the remote stream
    shuts down reading and/or writing
- This only happens once per lifetime of the stream; as a result, do NOT set more hooks while inside the body of
    the hooks themselves!
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