|
|
__init__(self,
numpieces,
rarest_first_cutoff=1,
rarest_first_priority_cutoff=3,
priority_step=20)
Initialize the instance and the piece interests. |
source code
|
|
|
|
_init_interests(self)
Initialize the interests in pieces to all not interested. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
became_seed(self)
Process this client becoming a seed. |
source code
|
|
|
|
|
|
|
requested(self,
piece)
Add a piece that a request has been sent for to the list of
started pieces. |
source code
|
|
|
|
|
|
|
|
int
|
next(self,
haves,
wantfunc,
complete_first=True)
Choose a piece to request to download next from a peer. |
source code
|
|
boolean
|
|
|
|
bump(self,
piece)
Move a piece to the end of its interest level. |
source code
|
|
boolean
|
|
boolean
|
|
|
|
set_superseed(self)
Switch to super-seeding mode. |
source code
|
|
int
|
next_have(self,
connection,
looser_upload)
Determine the next piece to tell a peer we have in super-seed
mode. |
source code
|
|
|
|
|
list of int
|
crosscount
at each index, the value is the number of pieces that have that
many copies in the non-seeding peers
|
list of int
|
crosscount2
at each index, the value is the number of pieces that have that
many copies in the non-seeding peers (including this peer)
|
int
|
cutoff
the number of peers which need to have a piece before other
partials take priority over rarest first
|
boolean
|
done
whether the download is complete
|
list of int
|
has
values are 1 for the pieces that this peer has
|
list of list of int
|
interests
the interest levels, each level is a list of piece indexes that
are at that level
|
list of int
|
level_in_interests
one per piece, the level that each piece is at in the
interests
|
int
|
numgot
the number of pieces this peer has
|
list of int
|
numhaves
the number of copies of each piece in non-seeding peers
|
int
|
numpieces
total number of pieces in the download
|
dictionary
|
past_ips
the IPs that have previously connected in super-seed mode, keys
are IP addresses, values are the piece have that was last sent to the
peer
|
list of int
|
pos_in_interests
the position within the interest level that each piece is at
|
list of int
|
priority
the priority of each piece:
|
int
|
priority_step
the difference bewteen priority levels 0, 1, and 2
|
int
|
rarest_first_cutoff
number of completed piece downloads at which to switch from random
piece selection to rarest first
|
int
|
rarest_first_priority_cutoff
the number of peers which need to have a piece before other
partials take priority over rarest first
|
dictionary
|
removed_partials
keys are the pieces that were started but then disabled
|
dictionary
|
seed_connections
connections that have been made in super-seed mode, keys are Connecter.Connection, values are the piece have that
was last sent to the peer
|
list of int
|
seed_got_haves
the number of copies of pieces in super-seed mode
|
float
|
seed_time
the time when the first peer was seen in super-seed mode
|
int
|
seeds_connected
the number of connected seeds
|
list of int
|
started
the pieces that have been requested for download
|
boolean
|
superseed
whether we are in super-seed mode
|
int
|
totalcount
the total number of copies of all pieces in non-seeding peers
|