Add a channel number lookup and an active-channel check - #592
Open
rg0now wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #592 +/- ##
==========================================
+ Coverage 82.42% 82.64% +0.22%
==========================================
Files 46 46
Lines 3305 3313 +8
==========================================
+ Hits 2724 2738 +14
+ Misses 377 374 -3
+ Partials 204 201 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
UDPConn maps a channel number back to its peer address, but not the other way round. The new FindChannelNumberByAddr accessor adds the missing direction with the semantics of its counterpart: it resolves a binding whether or not the server has confirmed it. To check whether a channel is established, a separate IsChannelActive(chan-id) reports whether the client uses a chan-id for writing. Also add tests cover all channel accessors.
rg0now
force-pushed
the
client-find-channel-by-addr
branch
from
August 24, 2026 16:35
6e1a473 to
71d0333
Compare
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.
This PR proposes a simpler alternative to the
PrepareUDPPeerclient API proposed in #585.Description
PR #585 adds
PrepareUDPPeer(ctx, peer)so an application can block until a peer has a confirmed permission and bound a channel before sending (this is useful for QUIC senders). This PR exposes the channel state instead of managing it, which allows a caller to poll the channel's active state to know when the channel comes online (and when it goes away).Added is a new
IsChannelActive(chNum uint16) boolclient API that reports the same conditionWriteTouses to choose ChannelData over a SendIndication. The PR also addsFindChannelNumberByAddr, the counterpart to the existingFindAddrByChannelNumber, so a caller holding a peer address can learn the channel number. Tests now cover all three accessors across every binding state.Reference
#585