Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

Fix/dial class #203

Merged
merged 6 commits into from
Mar 28, 2017
Merged

Fix/dial class #203

merged 6 commits into from
Mar 28, 2017

Conversation

dignifiedquire
Copy link
Member

No description provided.

src/dialer.js Outdated
}
}

module.exports = Dialer
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid putting several classes in the same file, we already learned how that ends from Java.

Copy link
Member Author

Choose a reason for hiding this comment

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

lol

Copy link
Member

Choose a reason for hiding this comment

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

ok, just missing this then :)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -87,8 +87,7 @@ module.exports = function dial (swarm) {
nextTransport(tKeys.shift())

function nextTransport (key) {
const multiaddrs = pi.multiaddrs.slice()
swarm.transport.dial(key, multiaddrs, (err, conn) => {
swarm.transport.dial(key, pi, (err, conn) => {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, I intentionally had made swarm.transport.dial be just multiaddr aware for simplicity, and so, it would only receive a multiaddr and not a peerInfo

swarm.transport.dial -> deals with dialing on a transport
swarm.dial -> does all the magic of upgrading the connection

Copy link
Member

Choose a reason for hiding this comment

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

This is kind of a breaking change on the API, not a biggie because it is more of an internal that is just exposed for testing, however, I'm not sure if I see the advantage, could you clarify?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am doing the same thing that go does, that is limiting dials per peer. To do that I need to know the peerId otherwise I can't track dials per peer

Copy link
Member

Choose a reason for hiding this comment

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

ok, we can keep it.

src/dialer.js Outdated
if (token.cancel) {
log('dialQueue:work:cancel')
// clean up already done dials
pull(pull.empty(), conn)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@daviddias daviddias merged commit 11e3a23 into master Mar 28, 2017
@daviddias daviddias deleted the fix/dial-class branch March 28, 2017 11:36
dryajov pushed a commit that referenced this pull request Mar 29, 2017
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.

2 participants