News for hackers. Stuff that matters.
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @07:51AM (#12035744)
If anyone's having issues, I've mirrored it at https://cheatdeath.github.io/research-bittorrent-doc/

edit: I'm the author, let me know if you have any questions.

Re:Building a BitTorrent client from scratch in C# by Sarkie on Tuesday July 05, 2016 @08:44AM (#12035964)
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @08:55AM (#12036041)
Sorry, I didn't update some of the links in the contents correctly when creating the mirror. They should be fixed now – everything is on one page.
Re:Building a BitTorrent client from scratch in C# by Zagitta on Tuesday July 05, 2016 @04:43PM (#12039415)
I don't know if you've seen it already but some people on reddit talked about some improvements/tips here: https://www.reddit.com/r/programming/comments/4rcss2/buildin...

I agree with most of their sentiments, especially the parsing part could be made cleaner/more C#'ish :)

Otherwise nice work and very interesting writeup!

Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @07:36PM (#12040265)
Thanks for letting me know, looks like I'll have to find some time to implement some of these recommendations.
Re:Building a BitTorrent client from scratch in C# by lossolo on Tuesday July 05, 2016 @07:55AM (#12035758)
Great work. Does it work under .NET Core ?
Re:Building a BitTorrent client from scratch in C# by jsingleton on Tuesday July 05, 2016 @08:04AM (#12035799)
From a quick look at the source [0], it looks like it supports Mono. I can't see anything stopping it being ported to Core, apart from JonSkeet.MiscUtil may not support Core.

If you package this up as a NuGet package and support Core then can you please ping me and I'll add it to https://anclafs.com.

[0] https://github.com/cheatdeath/research-bittorrent

Re:Building a BitTorrent client from scratch in C# by nick_ on Tuesday July 05, 2016 @07:46PM (#12040309)
I've been prototyping a .NET Core port. JonSkeet.MiscUtil source code is fine for Core, but for the BitTorrent code we need to change the HttpWebRequest objects to HttpClient and rewrite the Begin/End/IAsyncResult/callback-style to async/await.
Re:Building a BitTorrent client from scratch in C# by jsingleton on Thursday July 07, 2016 @01:58PM (#12051010)
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @08:16AM (#12035854)
I'm not that familiar with .NET Core. It doesn't look like MiscUtil is compatible with it.

The executable project has some minor references to Mono.Posix just so it can catch kill signals while running in the Terminal and die gracefully.

Both dependencies can be removed quite easily from the project.

Re:Building a BitTorrent client from scratch in C# by skrowl on Tuesday July 05, 2016 @09:24AM (#12036234)
Definitely having timeout issues on the OP link. Your €3/month hosting from blacknight.com isn't holding up to the HN load, apparently :)

Thank you for the github link. Mods can we get OP link adjusted to the github link instead of what was submitted?

Re:Building a BitTorrent client from scratch in C# by nick_ on Tuesday July 05, 2016 @04:02PM (#12039108)
Great to see an alternative to old MonoTorrent! I'm curious why you didn't use async/await instead of the Begin/End/IAsyncResult pattern?
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @07:42PM (#12040284)
Honestly I'm just not that familiar with async/await. I'll look into modifying it when I get around to making some other changes.
Re:Building a BitTorrent client from scratch in C# by nxzero on Tuesday July 05, 2016 @07:58AM (#12035774)
Awesome post/code; might be worth noting that you're the author of the code/post and your willingness to address questions.
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @08:00AM (#12035780)
Will do, thanks for posting.
Re:Building a BitTorrent client from scratch in C# by sctb on Tuesday July 05, 2016 @10:39AM (#12036718)
Thanks, we updated the link from http://seanjoflynn.com/research/bittorrent.html.
Re:Building a BitTorrent client from scratch in C# by cocotino on Tuesday July 05, 2016 @09:56AM (#12036429)
Your name from WoW?
Re:Building a BitTorrent client from scratch in C# by cheatdeath on Tuesday July 05, 2016 @10:04AM (#12036476)
World of Warcraft? Haha no, I've been using that handle probably since that game came out but I've never played it.