Мы создаем сеанс libtorrent следующим образом:
ses_settings = lt.session_settings()
ses_settings.ignore_limits_on_local_network = False
ses_settings.announce_to_all_trackers = True
ses_settings.ssl_listen = 0
ses = lt.session()
ses.listen_on(LISTEN_ON_RANGE_START, LISTEN_ON_RANGE_END)
ses.set_settings(ses_settings)
ses.set_download_rate_limit(download_rate)
ses.set_upload_rate_limit(upload_rate)
Как и в случае с ssl_listen, мы хотим отключить DHT, LSD, UPnP, NAT-PMP в сеансе libtorrent. Есть ли способ сделать это?
Также на странице руководства libtorrent это упоминается как:
Configuration options can be updated after the session is started by calling apply_settings(). Some settings are best set before starting the session though, like listen_interfaces, to avoid race conditions. If you start the session with the default settings and then immediately change them, there will still be a window where the default settings apply.
Changing the settings may trigger listen sockets to close and re-open and NAT-PMP, UPnP updates to be sent. For this reason, it's typically a good idea to batch settings updates into a single call.
Как выполнить пакетное обновление настроек за один вызов?
По сути, мы хотим изменить эти поля настроек по умолчанию: enable_lsd, enable_dht, enable_upnp, enable_natpmp
, а затем создать объект сеанса с этими настройками.
torrent_flags_t
. - person the8472   schedule 03.08.2019