support client reconnection after transport disruption#16
Open
kitknox wants to merge 4 commits intotrzsz:mainfrom
Open
support client reconnection after transport disruption#16kitknox wants to merge 4 commits intotrzsz:mainfrom
kitknox wants to merge 4 commits intotrzsz:mainfrom
Conversation
Allow clients to reconnect to a running tsshd by establishing an entirely new KCP or QUIC transport after the original connection and all its state have been lost. This enables recovery from network roaming, sleep/wake, and mobile use cases where the OS may terminate and relaunch the client app (e.g. Rootshell terminal on iOS). - Resume existing sessions by reattaching I/O to the new transport - Buffer stdout during handoff to prevent output loss - Replace bus stream on reconnect with identity-guarded cleanup - Gate non-bus streams on bus ownership to prevent hijacking - Track discard markers per-session to avoid cross-session interference - Accept transport connections in a loop to support reconnection - Add mutex protection to onExitFuncs and use context-based keepalive - Add tests for reconnection scenarios
Replace globalProtoServer.getUdpForwarder() with getActiveBusForwarder() since the reconnection model tracks forwarders per-connection via the active bus, not globally on the server. Update tests for new listenKCP signature and initialize globalServerProxy in bus forwarder test.
77d320d to
990f041
Compare
Member
|
@kitknox Thanks a lot for the PR and for taking the time to work on this! It’s very helpful and gives me a good starting point. I’d like to spend some time thinking about a cleaner refactor overall, so I may take a slightly different approach for the final implementation. I’ve just started my vacation, so it may take a few weeks before I can work on this properly. |
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.
Allow clients to reconnect to a running tsshd by establishing an entirely new KCP or QUIC transport after the original connection and all its state have been lost. This enables recovery from network roaming, sleep/wake, and mobile use cases where the OS may terminate and relaunch the client app (e.g. Rootshell terminal on iOS).