NAME
Net::BitTorrent::Storage
Introduction
Storage class wraps real storages and offers an interface to access
to those files like a stream.
[ piece ][ piece ][ piece ][ ] ... bittorrent pieces
[ file A ... ][ file B ...... ] ... real file storage
EXAMPLES
How to generate ‘pieces’
How to get BitField
How to download/upload files(pieces)
In BitTorrent peer-wire protocol, Request pieces.
and MetaInfo has the information to map piece to files.
In protocol layer, You do not need to care what
request:
REQUEST <index><offset><length>
responce:
PIECE <index><offset><subpiece: storage.read(index, offset, length))>
NOTES
- TODO make interface method to set ‘files’
- TODO I/O transaction
- TODO How to test ? (Mock I/O ?)
- TODO separate read/write wrapper and store/fetch method,
- TODO Set base path prefix for real file path.
- TODO catch exception if read wrong index without complete download.
AUTHORS