Handbook
Glossary
request-piece ( peer -- peer )
Vocabulary
bittorrent
Inputs
peer
an
object
Outputs
peer
an
object
Definition
USING:
accessors
io
kernel
math
math.order
namespaces
sequences
;
IN:
bittorrent
::
request-piece
( peer -- peer )
peer
current-index>>
[
peer
next-block
current-index>>
]
unless*
peer
current-piece>>
length
peer
piece-length>>
over
-
torrent-max-block-size
get
min
[
2drop
peer
verify-block
save-block
next-block
request-piece
]
[
request
boa
write-message
flush
peer
]
if-zero
;