简体   繁体   中英

Libtorrent How to set timeout?

I used add_magnet_uri access to information, but there are some resources to respond slowly, what should I use to set the total time-out?

http://www.rasterbar.com/products/libtorrent/manual.html

:( I did not find the relevant settings

params = {
            'save_path': '/home/sdht/data',
            'storage_mode': lt.storage_mode_sparse(),
            'paused': False,
            'auto_managed': True,
            'duplicate_is_error': True
        }
handle = lt.add_magnet_uri(self.ses, link, params)
    while (not handle.has_metadata()):
        time.sleep(.1)

There is no timeout on torrents failing to download in libtorrent. You can query the torrent for the timestamp when it was added, and if it was added long enough ago, and it's still not finished, you could remove it.

There's also not a lot of cost to having an idle torrent loaded, so you may want to add all the ones you want to resolve in parallel.

Also, you may want to be careful setting them all to auto_managed: True, because that way a stalled torrent may block new ones from being started. If you instead set auto_managed to False, they will all be force started.

Address: http://www.rasterbar.com/products/libtorrent/manual.html#session-settings

        sts.user_agent = "USA Global Download"
        sts.tracker_completion_timeout = 5
        sts.tracker_receive_timeout = 5
        sts.stop_tracker_timeout = 5
        sts.active_downloads = -1
        sts.active_seeds = -1
        sts.active_limit = -1
        sts.auto_scrape_min_interval = 5
        sts.udp_tracker_token_expiry = 120
        sts.min_announce_interval = 1
        sts.inactivity_timeout = 60
        sts.connection_speed = 10
        sts.allow_multiple_connections_per_ip = True
        sts.max_out_request_queue = 128
        sts.request_queue_size = 3
        sts.use_read_cache = False

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM