Thursday, June 29, 2006

TorrentService and TorrentPatron

The MainLine BitTorrent client is unfortunately not thread-safe, even segfaulting in some versions if you try to run two instances simultaenously. In any case, several BitTorrent clients would likely be less efficient than one controlling several downloads/uploads. To work around this problem, I've made it so a single TorrentClient (TC) can be shared between several components. TorrentPatron (TP) should now be used in place of TC in all user code. TP is completely compatible with TC's input/output IPC messages but any number of TPs can be created without things breaking.

When a TP spawns, it checks whether a TS exists. If it doesn't find one, it creates a new one. Either way it then registers with the TS to use the 'service' that TS provides. This then allows TP to relay requests to TC through TS and receive them from TC through TS in turn. TS co-ordinates how the TPs are 'multiplexed' to safely use TC together.

Labels: ,

Tuesday, June 27, 2006

IOI training weekend

Last weekend I attended an IOI training session in Guildford. Six of us - the British team and the two reserves selected at the BIO - were invited, with food, travel expenses, and lodgings all provided. The event was generously hosted and funded by Lionhead Studios. We were programming in the the room where they keep their BAFTAs!
It was very educational and relaxed weekend. We got a lot of work done over the Saturday and Sunday - covering a large amount of algorithms material, and doing a fair few past competition questions. I hadn't been to a BIO training weekend before, as they haven't done them over the last two years, so this was quite an experience, and a very enjoyable one at that.


Monday, June 19, 2006

Google Package

FedEx sent me tracking information about a package for me a few days ago. I received a pleasant surprise at about 8AM this morning - a notebook all the way from Google in California. I was barely awake so early, having been expecting it at around noon. The notebook has a nice black-blue covering (see right) - it's rather too nice to use. For now it's just for looking at.


Sunday, June 18, 2006


I've added multiple torrent support to my TorrentClient component through a complete rewrite of its interface to BitTorrent. It now requires MainLine (official BitTorrent client) beta 4.9.9 but unlike previous versions requires no changes to its code. This means that it will work straight-away on any machine with BitTorrent 4.9.9 installed. I've done some light testing and it successfully downloaded two test torrents overnight.

Tuesday, June 13, 2006

Progress and TDD

I have moved the HTTPParser component of HTTPServer to its own file. HTTP requests and responses are very similiar (the only major difference being the first line) so this allows some nice code reuse. As such, my new HTTPClient component also uses this parser component.

The BitTorrent-Kamaelia interface component now also works for those who have twisted installed.
I'm reading 'Test-Driven Development' - a book sent to me by the BBC (cheers!). It's a programming methodology that advocates writing automated tests and then code to satisfy those tests in that order rather than coding and then testing it.

Tuesday, June 06, 2006

HTTPServer fixed

HTTPServer is now fixed - the charset issues have been resolved and it no longer uses 100% CPU all the time (thanks to changes to Axon and the Kamaelia TCP components). It also closes connections when appropriate. Kambot now allows timed reminders to be set which may prove useful.

Friday, June 02, 2006

Kamaelia Wiki

I've started a Kamaelia Wiki that I (and others if they wish) can use to document Kamaelia and our Kamaelia-related projects.