[Libtorrent-devel] start/stop & open/close?

Josef Drexler josef at ttdpatch.net
Thu May 15 09:45:41 UTC 2008


On May 15, 2008, at 8:12 AM, Wei-Hao Cheng wrote:
> Hi,
>
>     Does anyone know what is the difference between d.start/d.stop  
> and d.open/d.close in
> XMLRPC?

Start opens and starts the download. Open only opens but does not  
start it. (It only does a hash check if needed to find out how much  
of the download is complete.)
Stop stops the download. Close also closes the files after stopping  
it and discards partially transferred chunks.

>     I use the patch to add throttle for each download (http:// 
> libtorrent.rakshasa.no/ticket/
> 20#comment:17), but it needs to inactive the download before  
> setting the throttle. It stops
> the downloading peers and re-connects to other peer and extends the  
> download time. How
> to solve this problem?

Use d.stop to stop the download, then set the throttle with  
d.set_throttle_name, and then call d.start to start it again. If  
possible, set the throttle name before the download is started the  
first time, e.g. in a load_start command.

Note that stopping the download is only needed when you want to  
attach a different throttle to a download. To change the upload/ 
download rate of a throttle you do not need to stop any downloads,  
just use the "throttle" command again.

-- 
Josef Drexler
josef at ttdpatch.net





More information about the Libtorrent-devel mailing list