Рет қаралды 30,373
After doing the BitTorrent CodeCrafters challenge in #rustlang ( • Implementing (part of)... ), I had an urge to do some re-organization to better fit what a real implementation would look like when it has to handle files, multiple peers, multiple pieces, concurrency, etc. So, that's what we did!
If you want to give the whole challenge a try, please consider using my refrral link: app.codecrafters.io/join?via=...
0:00:00 Recap
0:11:18 Writing what we want to end up with
0:21:28 Writing the interface outside-in
0:36:56 Grabbing peer info
0:42:44 Interacting with a single peer
0:56:10 Decoding which pieces a peer has
1:34:11 Moment of hesitation
1:39:15 Ordering pieces
1:53:11 Connecting to a pool of peers
2:05:10 Grabbing pieces one by one
2:20:09 Cooperatively download all the blocks!
3:11:23 Handling choking
3:28:06 Putting together all the pieces
3:35:29 Fixing the one bug
3:45:23 The many things that remain
Stream diff: github.com/jonhoo/codecrafter...
Live version with chat: kzbin.info8sEdv0G1VIE