Bah, I had already forgotten how much time it takes to write a new module for Hydranode - let's face it, it's been a while since I started a new network module. IIRC, the previous one was FTP, and I only spent one night on it (got data structures up, but got stuck at some parsing stuff). FTP module can be finished w/o issues now, as we have the power of Boost.Spirit around, which is ideal for that parsing (actually it's been bugging me ever since I learned Boost.Spirit - how perfect it is for the FTP module parsing problem
Anyway, it took
two weeks to get BT module to the state where it is now - that is, downloading the first bytes. Let me rephrase that: I just
downloaded the first bytes using BT plugin. Proof? Here's
a trace log. Okey okey, not a big thing, but a milestone non-the-less.
For the record, that's a free, creative-commons-licenced mp3 collection.So, two weeks of work to get this far? But on the other hand, look what the time has been spent on:
- August 18, 19, 20: Learning Boost.Spirit parsing framework, first parsing of .torrent file
- August 21, 22, 23, 24, 25: Data structures design, integration between BT file-less download system and Hydranode file-based download system.
- August 26: Tracker communication implementation
- August 27: Client management design, initial Client<->Client communication
- August 28, 29, 30: Debugging Client<->Client communication
- August 31: First bytes downloaded off BT network
Right now, BT module code is ~2700 lines of code. As comparison, eDonkey module is 12'600 lines of code. I estimate BT module to top at around 5000-7000 lines of code, maybe more with trackerless implementations. So - in 2-3 more weeks, and we should have a working BT module...
Anyway, as an observant reader might'v noticed, the bytes downloaded were 3x 9 bytes from 3 different chunks. Not very fancy - seems PartData chunk/lock-selector isn't doing it's job right. But not to worry, Madcat has a plan. More on this tomorrow :)
Madcat, ZzZz
PS: The module code is now properly documented; view it, as usual, in the
DevCenter SVN browser.