Skip to content
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

Support uTP Connections #11

Merged
merged 3 commits into from Dec 2, 2014
Merged

Support uTP Connections #11

merged 3 commits into from Dec 2, 2014

Conversation

ghost
Copy link

@ghost ghost commented Oct 26, 2014

Will attempt a uTP connection and then fallback to a normal connection if it seems like the peer doesn't support it or the connection times out.

XeonCore added 2 commits October 26, 2014 14:52
Enable support for connecting to peers using the uTP protocol
});
});
})
Copy link
Author

Choose a reason for hiding this comment

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

Bugger, missed a ;. This is annoying me now...

@mafintosh
Copy link
Owner

Can we make the utp stuff opt-in? As in default behavior is the same as before but if you set utp: true it will try to do utp first.

If it turns out the utp stuff is really stable we could enable it per default

@mafintosh
Copy link
Owner

Also this module badly needs some tests. If you are up for helping out with that let me know :)

@ghost
Copy link
Author

ghost commented Oct 26, 2014

I did a lot of testing and in all my tests it worked almost perfectly. Managed to get over 15MB/s from uTorrent using it in torrent-stream.

I'm also auditing the uTP module at the moment to bring it more up to spec 😄

@ghost
Copy link
Author

ghost commented Oct 26, 2014

Bam! Done 😄

@mafintosh
Copy link
Owner

Awesome. Last thing. Is the custom timeout event because my utp module doesn't currently emit close on destroy (like regular tcp connections)?

@ghost
Copy link
Author

ghost commented Oct 26, 2014

No, its there so you can tell the difference between a failed UDP connection and a gracious close. Because UDP has no concept of a connection the only way to count it as "failed" is waiting for it to timeout. If we listened on close it would be triggered on a normal utp close which would lead it to retry connecting to the peer over TCP when we actually wanted to disconnect from the peer.

@ghost
Copy link
Author

ghost commented Dec 2, 2014

Can I bump this please? Would love to get this upstream so we can depend on the official npm module again!

mafintosh added a commit that referenced this pull request Dec 2, 2014
@mafintosh mafintosh merged commit 5b9cfaa into mafintosh:master Dec 2, 2014
@ghost ghost mentioned this pull request Dec 2, 2014
@ghost
Copy link
Author

ghost commented Dec 2, 2014

Oh yay @mafintosh Thanks :)

mafintosh added a commit that referenced this pull request Dec 2, 2014
@mafintosh
Copy link
Owner

Released in 0.10.0. I simplified the code a little bit. Could you test it out?

@mafintosh
Copy link
Owner

(sorry about the delay - forgot about this pr)

@ghost
Copy link
Author

ghost commented Dec 2, 2014

I left a comment on the commit. I could be wrong, but it looks to me as if it emits listening on the swarm before anything is actually listening?

@gyzerok
Copy link

gyzerok commented Mar 20, 2015

@mafintosh whats current status on this?

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