Skip to content
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

impossible to observe holepunch using Connectedness event when using an unlimited relay #3101

Open
marten-seemann opened this issue Dec 16, 2024 · 1 comment

Comments

@marten-seemann
Copy link
Contributor

I'm trying to observe the establishment of a connection from relayed to direct (using DCuTR).

Initially I thought that I could use the Connectedness' Limited state for that. This works find when using a limited relay, but it fails for an unlimited relay:

if limit := msg.GetLimit(); limit != nil {
stat.Limited = true

A connection via an unlimited relay is considered Connected right away, and the establishment of a direct (hole-punched) connection doesn't trigger another event, since we're already "connected".

The best resolution I could come up with is the following: Split the Limited state into two: Relayed and RelayedUnlimited. This is a breaking change obviously, but at it's made explicit by the removal of Limited, forcing users of the library to rethink their logic.

@vyzo
Copy link
Contributor

vyzo commented Dec 16, 2024

I think it would male more sense to have a Relayed flag, in conjunction with Limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants