Blog

Posted 2006/03/24

TychoTorrent cont.

Thought I’d give it a name. This week I switched from a single threaded implementation to a parallel version, which as we know is easy peasy.

All of the basic functionality is complete - peers can discover and download chunks and can upload these chunks to other peers before the whole file is complete. I have used some of the algorithms described as part of the official Bittorrent protocol to decide what chunks to download but have not spent too much time implementing the complex tit-for-tat downloading/uploading mechanisms - we are trying to show off Tycho, not write a better Bittorrent (at the moment).

Making the code multi-threaded has of course created all the normal problems but as best as I can tell there is only one large bug at the moment - you can break a peer by killing a download source between the time that a file has been allocated for downloading and when the first bytes are sent. I don’t think this is an artefact of the parallelisation process, just a cock up in the protocol implementation.

I will try and fix this bug over the weekend. The next step will be to plug it into my Tycho game middleware. This means the demo will be a GUI which can find game servers using Tycho with a button to check you have all of the files you need to play the game which can then go away and download missing content ‘Bittorrent style’.