Repository navigation
Pair on the server's existing connection to a client - #345
Merged
Merged
Conversation
A server could pair over a second connection to a client it was already connected to, and nothing defined what happened to the first connection once pairing finished.
1 of 9 tasks
maximmaxim345
added a commit
to Sendspin/aiosendspin
that referenced
this pull request
Nov 16, 2026
…616) # What does this implement/fix? <!-- Quick description and explanation of changes. --> Pairing a client while the server was reconnecting to it waited for that whole session to end, because the attempt was queued for the next dial. `connect_to_client` and `connect_to_client_and_wait` with a `pairing_attempt` for a client that is already connected opened a second connection to it. Both now pair on the connection the server already holds. `connect_to_client_and_wait` returns right away in that case, without waiting for the pairing to finish. **Related issue or spec PR (if applicable):** - Sendspin/spec#345 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the matching label, and the release notes use it to sort this change. --> - [x] Bugfix (non-breaking change which fixes an issue): `bugfix` - [ ] New feature (non-breaking change which adds functionality): `new-feature` - [ ] Enhancement to an existing feature: `enhancement` - [ ] Breaking change (changes the public API or the protocol in a way that is not backwards compatible): `breaking-change` - [ ] Refactor (no behavior change): `refactor` - [ ] Documentation only: `documentation` - [ ] Maintenance / chore: `maintenance` - [ ] CI / workflow change: `ci` - [ ] Dependencies bump: `dependencies`
48 of 58 tasks
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.
Multiple connections from one server to the same client were never explicitly invalid in the specification. This makes a server pair on the connection it already holds instead of opening a second one, since one connection can already carry
['playback', 'pairing']. When that connection can't carry the chosen method, such as a code-based pairing over a long-term PSK, the server closes it and reconnects.A more general one connection per client rule is not needed, since a second playback connection from the same server already displaces the first one. It would also block a server from reconnecting before it notices the old connection is dead.