You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libp2p Swarm currently does NOT allow two peers to create a new connection between them if one already exists.
This makes it difficult to hole punch via Relays and allow peers to choose the direct hole-punched connections over the existing Relay connection once we have the connection upgrade protocol in place.
The text was updated successfully, but these errors were encountered:
aarshkshah1992
changed the title
Swarm should allow creating a new connection between peers even if one already exists
NAT traversal: Swarm should allow creating a new connection between peers even if one already exists
Nov 5, 2020
I'm not sure at what level this should live. We could:
Have a dial option to force dial a specific set of transports/addresses.
Let the swarm itself decide if/when to "upgrade".
I'm wary of adding too much logic to the swarm, so I'd prefer the first option if we can make it work. I'm thinking something like:
Auto -- the default, just make sure there is a connection.
Direct -- try to create a direct connection, even if we have a connection.
OneOf(addressess...) try to form a connection to a specific target address.
To actually implement this, we'd likely need to restructure our dialing a bit. Currently, we coalesce all dials to a peer so there's no way to add in dial constraints after the fact when we have multiple concurrent dials. That'll need to change.
The simplest approach is probably to launch some kind of per-peer "dial" process that takes new dial requests and notifies these dial requests when their conditions have been satisfied.
libp2p Swarm currently does NOT allow two peers to create a new connection between them if one already exists.
This makes it difficult to hole punch via Relays and allow peers to choose the direct hole-punched connections over the existing Relay connection once we have the connection upgrade protocol in place.
The text was updated successfully, but these errors were encountered: