Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

feat: retrieve peers on connect #64

Merged
merged 4 commits into from Nov 28, 2018

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Nov 26, 2018

Get peers from rendezvous server on connect, and emit a peer event for each one

Depends on libp2p/js-libp2p-websocket-star-rendezvous#27
See peer-base/peer-base#75 (comment) for details

cb()
})
}), done)
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Browser tests are failing because it's trying to spin up a rendezvous server. Aegir spins up a few servers in .aegir.js, https://github.com/libp2p/js-libp2p-websocket-star/blob/v0.9.1/.aegir.js#L9. Using those servers should resolve the failing browser tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I was spinning up new rendezvous servers was that the existing servers still had some state from previous tests. So now instead of spinning up new servers I made some changes to the previous tests to clean up old connections

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

The issue with the lingering connections is that .close is not actually closing the sockets. Per the interface-transport, https://github.com/libp2p/interface-transport#stop-a-listener, .close should have a timeout to forcefully close connections. Right now it just waits for them to close themselves which is why the other tests needed to have their pull streams ended.

This needs to get fixed, but shouldn't block this PR. This effort would be good to lump in with the accept/reject updates https://github.com/libp2p/interface-transport/issues/39.

@jacobheun jacobheun merged commit ae9fb1c into libp2p:master Nov 28, 2018
@dirkmc dirkmc deleted the feat/get-peers-on-connect branch November 28, 2018 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants