-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add function to check if connection/stream is open #2514
Comments
This functionality doesn't exist in S2N-QUIC today. The connection would need to provide a way to subscribe to closure event. |
It would be preferable to have a function that could be used to check the status. Having to send that information from a subscriber function call to the owner of the stream would be a lot of boilerplate and a huge hassle. |
The race(connection.wait_close(), channel.recv()).await; |
I guess I should ask this then, should I reformat this question issue to be instead a feature request? |
Yes, that would be great. Thanks! |
Problem:
When creating a stream if you close it's related
Connection
there is no way to check via theStream
if theStream
is still open/valid. This can be a problem if you are assigning aStream
to their async task but handlingConnection
management behaviour in another task, especially if you split aStream
into aSendStream
and aReceiveStream
and handle their respective logic on separate tasks. If you close a connection in one task, there needs to be a way for all related streams to know that their stream has been closed.Solution:
A simple function within a
Connection
and respectiveStream
structs to query the connection's status would solve this problem quite easily.Does this change what s2n-quic sends over the wire?
Nope, this functionality should already exist within
send()
andreceive()
in theory as these functions can error if the stream has been disconnectedDoes this change any public APIs?
Yes, connections and streams will have a new function, this shouldn't conflict with existing usages of s2n-quic though as it's an addition.
Requirements / Acceptance Criteria:
is_open()
function and verify it returns false (or whatever return type/value that signifies a closed connection)Original Question
The text was updated successfully, but these errors were encountered: