-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Connect should wait for an acceptable connection #1603
Comments
Notes after syncing with @Stebalien:
|
@marten-seemann : should this be opened or closed? I wasn't sure given the PR was merged but it was reopened. |
@marten-seemann @p-shahi : is this still an issue? (I'm asking because I'm trying to figure out if can close ipfs/kubo#9751 ). Thanks. |
Yes, we haven't fixed this yet. |
Gentle bump, just for the record ipfs/kubo#9751 is still a problem. |
I'll submit a repro later this week. |
The PR I've raised changes Why to do this in NewStream as opposed to DialPeer.
|
Need to merge #2542 to close this. |
Currently, it waits for any connection, then returns. Unfortunately, this means that if the user calls
host.NewStream(peer)
to try to get a new stream to a non-connected peer, we'll fail every single time if we try to create a stream behind a NAT.The difficulty here is that we aren't "in control", and don't know if the remote peer will actually directly connect to us. It's up to the receiver to establish a direct connection.
I think the solution here is to wait a bit after we establish a transient connection to see if a non-transient connection comes through. The tricky part will be actually implementing that...
The text was updated successfully, but these errors were encountered: