MonoTorrent 客户端不使用元数据模式从另一个对等点下载文件:
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 文件,一切正常。