Skip to content

ConnectionContext.Transport.Output.CompleteAsync() should only half close connection #14937

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

Open
halter73 opened this issue Oct 11, 2019 · 1 comment
Assignees
Labels
affected-very-few This issue impacts very few customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions 🥌 Bedrock enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-kestrel severity-nice-to-have This label is used by an internal tool
Milestone

Comments

@halter73
Copy link
Member

Today ConnectionContext.Transport.Output.CompleteAsync() fully closes the connection with both the libuv and managed socket transport. As soon as the transport send loop sees a completed ReadResult, it calls Socket.Shutdown(SocketShutdown.Both) or an equivalent. This prevents the application from reading more from ConnectionContext.Transport.Input even if the other side of the connection did not finish sending data.

Given that ConnectionContext.DisposeAsync() now exists and also fully closes the connection, the contract for ConnectionContext.Transport.Output.CompleteAsync() should change to only close the sending side of the connection. The converse should also be true for ConnectionContext.Transport.Input.CompleteAsync(). DisposeAsync() should continue to fully close the connection after the send loop completes like it does today, and Abort() will continue to immediately terminate the connection.

@halter73
Copy link
Member Author

@davidfowl

@analogrelay analogrelay added this to the Backlog milestone Oct 15, 2019
@davidfowl davidfowl modified the milestones: Backlog, 5.0.0-preview1 Oct 15, 2019
@analogrelay analogrelay removed this from the 5.0.0-preview1 milestone Mar 11, 2020
@shirhatti shirhatti added this to the Backlog milestone Mar 27, 2020
@jkotalik jkotalik added affected-very-few This issue impacts very few customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-nice-to-have This label is used by an internal tool labels Nov 13, 2020 — with ASP.NET Core Issue Ranking
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-very-few This issue impacts very few customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions 🥌 Bedrock enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-kestrel severity-nice-to-have This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

6 participants