Managing Torrents
Version 2 (olivier dufour, 04/08/2009 08:58 AM) → Version 3/18 (olivier dufour, 04/08/2009 08:58 AM)
h1. Client example
<pre><code class="c#"> class="csharp">
ClientEngine engine = new ClientEngine(new EngineSettings(downloadsPath, port));
//DHT
DhtListener dhtListner = new UdpListener (new IPEndPoint (IPAddress.Any, port));
DhtEngine dht = new DhtEngine (dhtListner);
engine.RegisterDht(dht);
dhtListner.Start();
//byte array of dht nodes
engine.DhtEngine.Start(nodes);
torrent = Torrent.Load("test.torrent");
TorrentManager manager = new TorrentManager(torrent, downloadsPath, torrentDefaults);
//FastResume code need a BencodedDictionnary
manager.LoadFastResume(new FastResume (BEncDictFastResume));
engine.Register(manager);
manager.Start ();
</code>
</pre>