Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get MonoTorrent to download #42

Closed
hexafluoride opened this issue Jul 23, 2014 · 2 comments
Closed

Can't get MonoTorrent to download #42

hexafluoride opened this issue Jul 23, 2014 · 2 comments

Comments

@hexafluoride
Copy link

I'm trying to download some files and both with the SampleClient, and using the code below, it always stays at Downloading, and 0 percent.
I've tried downloading various torrents including Linux distros.

What could cause this?

Console.WriteLine("Torrent test...");
Torrent t = Torrent.Load("/path/to/torrent");
TorrentSettings s = new TorrentSettings();
s.MaxConnections = 100;
s.InitialSeedingEnabled = true;
s.MaxDownloadSpeed = 500;
s.MaxUploadSpeed = 100;
s.UploadSlots = 4;
s.EnablePeerExchange = true;
s.UseDht = true;
TorrentManager tm = new TorrentManager(t, "/path/to/save/location", s);
EngineSettings es = new EngineSettings();
es.AllowedEncryption = EncryptionTypes.All;
es.ListenPort = 22239; // forwarded, both UDP and TCP
es.PreferEncryption = true;

ClientEngine engine = new ClientEngine(es);
engine.Register(tm);
tm.Start();
Console.WriteLine(engine.IsRunning); // outputs True
while (true)
{
    Console.WriteLine(tm.State.ToString() + ", " + tm.Progress); // just keeps outputting "Downloading, 0"
    System.Threading.Thread.Sleep(1000);
}
@hhowe29
Copy link

hhowe29 commented Aug 1, 2014

Try putting break points in these key places and see if the code is getting hit :

TrackerManager.Announce << did it even try to announce
TrackerManager.OnAnnounceComplete << did the announce go through
SocketListener.EndAccept << anyone try to connect to you
ConnectionManager.ConnectToPeer << did you try to connect to anyone else

My guess is that your announce is getting blocked or not returning any peers. See if you get any peers back in OnAnnounceComplete.

@hexafluoride
Copy link
Author

Never mind, it eventually finds some peers, it just takes a long time on some torrents for some reason.
Seems to be random behavior too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants