BitTorrent Sharing Service
The TorrentService component provides a service that allows the sharing of a single BitTorrent Client with more than one component that might want to use it.
Use the TorrentPatron component to make use of BitTorrent through this service.
Generally, you should not create a TorrentService yourself. If one is needed, one will be created by TorrentPatron. If a TorrentService already exists, creating one yourself may crash Python (see the effects of creating two TorrentClient components in TorrentClient.py)
The shutting down of this component (when it is no longer in use) is very ugly.
This component forwards messages from TorrentPatrons to a single TorrentClient it creates and also delivers responses from TorrentClient to the TorrentPatron appropriate to the response content.
TorrentClient handles new torrent requests sequentially, so as long as we keep a record of what order the requests of TorrentPatrons were forwarded, we can work out who to send TorrentClient's response to. Then, since all further messages are assigned a torrentid by TorrentClient, we can route all messages labelled with a particular id to to the TorrentPatron that started that torrent.
TorrentService() -> new TorrentService component
Use TorrentService.getTorrentService(...) in preference as it returns an existing instance, or automatically creates a new one.
Methods defined here
Registers a TorrentPatron with this service, creating an outbox connected to it
Deregisters a TorrentPatron with this service, deleting its outbox
Send a message to a TorrentPatron
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.