Skip to content

Better handle networks with multiple NATS#9

Open
Stebalien wants to merge 3 commits into
fd:masterfrom
Stebalien:multi-nat
Open

Better handle networks with multiple NATS#9
Stebalien wants to merge 3 commits into
fd:masterfrom
Stebalien:multi-nat

Conversation

@Stebalien
Copy link
Copy Markdown

This:

  1. Provides a way to iterate over all discovered NATs.
  2. Tries to pick the best one.

(also fixes possible goroutine leaks when multiple NATs are discovered)

Honestly, the best way to handle mulitple NATs would be to try to configure all of them. However, this is a simpler interim solution.

This change makes it possible to configure all discovered NATs, not just the
first one found.
Comment thread nat.go Outdated
go func() {
defer close(nats)

ctx, cancel := context.WithCancel(context.Background())
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious what is the difference from the first input ctx argument?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bug.

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

Successfully merging this pull request may close these issues.

2 participants