Handbook
Glossary
piece
Vocabulary
bittorrent
Definition
IN:
bittorrent
TUPLE:
piece
index begin block
;
Methods
USING:
accessors
bittorrent
kernel
sequences
;
M::
piece
handle-message
( peer message -- peer )
peer
current-index>>
message
index>>
assert=
peer
current-piece>>
length
message
begin>>
assert=
message
[
block>>
]
[
begin>>
]
bi
peer
current-piece>>
copy
peer
request-piece
;
USING:
accessors
bittorrent
io
kernel
math
sequences
;
M:
piece
write-message
[
index>>
]
[
offset>>
]
[
block>>
]
tri
dup
length
9
+
write-int
7
write1
[
write-int
]
[
write-int
]
[
write
]
tri*
;