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

How to refactor Peer.rb to know when it is a Seed? #question #3

Open
rafapolo opened this issue Jul 2, 2014 · 1 comment
Open

How to refactor Peer.rb to know when it is a Seed? #question #3

rafapolo opened this issue Jul 2, 2014 · 1 comment

Comments

@rafapolo
Copy link

rafapolo commented Jul 2, 2014

Hello, I've been using RubyTorrent in a huge project to distribute a Archive of Public Papers, but I have to refactor it in such way we could count all Peers that are real Seeds - which have 100% of the files, and thats where we ask for conceptual help.
I think it can be inferred by the :state, or not?
https://github.com/willchapin/RubyTorrent/blob/master/lib/ruby_torrent/peer.rb#L8
Thank you

@willchapin
Copy link
Owner

Hi, rafapolo. This is probably too late to be useful (sorry!), but if you want to identify a peer as being seed/non-seed, you will need to look at that peer's Bitfield. A peer with a full bitfield (ones for all pieces) is a seed peer.

Let me know if you have any additional questions!

@willchapin willchapin reopened this Mar 7, 2015
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

No branches or pull requests

2 participants