fix: add recurrent graceful close for raw TCP - #13
Merged
Merged
Conversation
Add a small Client and Remoter close primitive that waits for queued output, shuts down writes once, waits for peer EOF, and then closes. Shutdown failures remain visible through the endpoint error and direction state. Client now records successful local half-closes. TLS force-close overrides bypass raw socket shutdown so this raw bookkeeping does not change TLS semantics before recurrent close_notify support lands.
Collaborator
Author
|
Upstream prerequisite: an accepted directional-state and terminal-cause contract for Client and Remoter, equivalent to #9/#10 and the Remoter behavior proposed by ioflo#163. This raw TCP behavior does not depend on #11/#12's TLS classifications. It can be adapted once queued output drains independently of local receive EOF and local write shutdown can be represented without conflating both directions. |
This was referenced Aug 28, 2026
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ClientandRemoter.SHUT_WR.Why
Immediate close can discard accepted output. Raw TCP shutdown is directional: graceful close must settle egress before local write shutdown and keep local receive available for final peer input.
Background
This is a recurrent transport primitive, not an owner state machine. Higher-level owners remain responsible for protocol completion, continued service, deadlines, and choosing force-close when settlement cannot finish.
Boundary
This PR does not define HTTP framing policy, owner deadlines, or TLS
close_notifyshutdown.