Summary
BitTorent protocol for peer-to-peer file sharing.

Meta-data
Authors:John Benediktsson


Words

Tuple classes
ClassSuperclassSlots
allowed-fast tupleindex
bitfield tuplebitfield
cancel tupleindex begin length
choke tuple
extended tupleid payload
handshake tuplestring reserved info-hash peer-id
have tupleindex
have-all tuple
have-none tuple
interested tuple
keep-alive tuple
not-interested tuple
piece tupleindex begin block
port tupleport
reject-request tupleindex begin length
request tupleindex begin length
suggest-piece tupleindex
unchoke tuple
unknown tupleid payload


Generic words
WordStack effect
load-metainfo( obj -- metainfo )
write-message( message -- )


Symbol words
torrent-peer-id
torrent-port


Ordinary words
WordStack effect
<handshake>( info-hash peer-id -- handshake )
>message( bytes -- message )
ALPHANUMERIC( -- value )
announce-url( metainfo -- url )
bitfield-index( n -- j i )
check-bitfield( n bitfield -- ? )
http-get-bencode( url -- obj )
info-hash( metainfo -- hash )
load-tracker( torrent -- response )
message>( message -- bytes )
parse-message( bytes -- message/f )
parse-peer4( peerbin -- inet4 )
parse-peer4s( peersbin -- inet4s )
parse-peer6( peerbin -- inet6 )
parse-peer6s( peersbin -- inet6s )
random-peer-id( -- bytes )
read-handshake( -- handshake/f )
read-int( -- n/f )
read-message( -- message )
scrape-url( metainfo -- url/f )
send-event( torrent event -- response )
set-bitfield( elt n bitfield -- )
tracker-url( metainfo -- url )
write-handshake( handshake -- )
write-int( n -- )


Class predicate words
WordStack effect
allowed-fast?( object -- ? )
bitfield?( object -- ? )
cancel?( object -- ? )
choke?( object -- ? )
extended?( object -- ? )
handshake?( object -- ? )
have-all?( object -- ? )
have-none?( object -- ? )
have?( object -- ? )
interested?( object -- ? )
keep-alive?( object -- ? )
not-interested?( object -- ? )
piece?( object -- ? )
port?( object -- ? )
reject-request?( object -- ? )
request?( object -- ? )
suggest-piece?( object -- ? )
unchoke?( object -- ? )
unknown?( object -- ? )


Files