MonoTorrent和元数据模式

时间:2011-05-03 10:08:02

标签: c# .net p2p monotorrent info-hash

MonoTorrent客户端不使用matadata模式从另一个对等方下载文件:

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 DhtEngine(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();

如果我使用托管元数据的torrent文件,一切正常。

1 个答案:

答案 0 :(得分:4)

基本上,MonoTorrent的DHT实施严重受损。我已经能够(部分地)使用它,但重新实现它比修复它更好。

我也有兴趣让MonoTorrent工作......