c# - Save Individual Torrents with Libtorrent save_state()? -


I am currently working with a CLI Libtorrent wrapper.

I got a brick wall. Perhaps this is an implementation flaw of the wrapper I am using, or I misunderstood the Liborant API documentation, but I do not understand how the current session status data can be saved / loaded. .

My current goal, as I can tell it in the best position, is to save all torrent_handle in the current session so that when I run Torrent client, then I work I am able to load them automatically at startup and start downloading / resizing.

I am still unsure whether or not I should do this to save the session. According to the words:

The saved_state can be used to filter the arguments of the passes that are used to save part of the session. By default, all state is saved (for individual torrent).

but I can not see a flag related to enum save_state_flags_t {save_settings = 0x001, save_dht_settings = 0x002, save_dht_state = 0x004, save_proxy = 0x008, save_i2p_proxy = 0x010, save_encryption_settings = 0x020, save_smap = 0x040, save_feeds = 0x080};

In addition, the cover is currently hard coded to not accept these flags:

  cli :: array & lt; Byte & gt; ^ Session :: SaveState () {Libtorrent :: Entry Entry; This- & gt; _session-> Save_state (login); Utils return :: GetByteArrayFromLibtorrentEntry (entry); }  

It should be easy to decide, but am I forgetting something? Am I trying to save through the wrong system?

The libtorrent does not provide a mechanism to save the torrent list. Hopefully (the customer) keeps new files on the disk (as they are irreversible) and then add them again, you start adding them the first time.

An exception occurs when adding a magnet link, you need to be able to turn a torrent_handle into a real .torrent file. To do this, this is a snippet:

  Boost: intrusive_ptr  

However, as a part of resume data, possibly an even better option. Save the file (or info-dict). On the call, if you pass in the flag, then start over again, the data will include everything that you need to restart the torrent. That is, the actual copy of the actual file will be saved inside the resume file.

The example that comes with Libertarian, just keeps new files in a directory, and scans the directory on startup (and periodically), so the file system stores the list of files One more efficient way to do this is to store the actual database that resumes in the database (say, SQLite).

Here is an example which is Inside a sqlite database

,

The database builds for a more efficient startup, when all those loads start with data with torrents, you can use a disk Saves in search of the pair).


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -