开发者

MonoTorrent and metadata mode

开发者 https://www.devze.com 2023-03-02 17:14 出处:网络
MonoTorrent client doesn\'t download file from another peer using matadata mode: var torrentDefaults = new TorrentSettings {

MonoTorrent client doesn't download file from another peer using matadata mode:

var torrentDefaults = new TorrentSettings {
   UseDht = true, 
   EnablePeerExchange = true
};
var engine = new ClientEngine();

engine.ChangeListenEndpoint(new IPEndPoint(IPAddress.Any, port));

var dhtListner = new DhtListener(new IPEndPoint(IPAddress.Any, port + 1));
var dht = new DhtEng开发者_如何转开发ine(dhtListner);


var infoHash = InfoHash.FromHex("07E45F689860166CC41E44C8F07901E3E8D27D42");
var announces = new[] {
   new RawTrackerTier(new[] {"http://somehostname:8080/announce"})
};

var torrentManager = new TorrentManager(
   infoHash, downloadsPath, torrentDefaults, torrentsPath, announces);

engine.Register(torrentManager);

engine.RegisterDht(dht);
dhtListner.Start();
engine.DhtEngine.Start();
engine.StartAll();

If I use torrent file insted of metadata everything works fine.


Basically, MonoTorrent's DHT implementation is badly broken. I've been able to get it to work (partially), but it's better to reimplement it than fix it.

I'm interested in getting MonoTorrent to work, too...

0

精彩评论

暂无评论...
验证码 换一张
取 消