-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seed a torrent #50
Comments
Disk readsCurrently the communication between peer session and the disk tasks is through an indirection: the peer session sends a request to disk, disk sends the result to torrent, torrent performs some bookkeeping and forwards it to peer. This same mechanism is used for reading blocks and returning them to the peer session that requested it. This is for simplicity, as the communication infrastructure already exists. Flow
There is one problem here: we need to identify the peer session to which torrent should forward the block. Two solutions:
There is slight communication overhead in the second solution as creating and destroying the peer's The second solution is chosen for simplicity. Upload optimizationRead as many requests from peer tcp socket as possible and batch block reads. Send batch of blocks to disk and await a list of blocks to return. Disk IO uses a read cache but this would optimize away mpsc communication overhead. |
Disk IO
Peer
Torrent
stop torrent alert (sent by engine)separate MR, out of scope (Use channels for engine-torrent communication #62)Engine & CLI
engine
'torrent complete' alert from torrent to engine, stopping a download sessionseparate MR, out of scope (Use channels for engine-torrent communication #62)Integration tests
Use cratetorrent for seeding and downloading as we already have test infrastructure to easily set up and verify cratetorrent downloads. As a next step we could have leech tests for e.g. transmission to ensure compatibility, but probably not before alpha release.
The text was updated successfully, but these errors were encountered: