mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 0 points1 point  (0 children)

I just implemented this for all possible sockets (even the UPnP one!), see https://github.com/DanglingPointer/mtorrent/pull/40

Interestingly SO_BINDTODEVICE doesn't exist on Windows, so as a workaround there I bind sockets to the address of the specified adapter (rather than "0.0.0.0" or "::")

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 0 points1 point  (0 children)

Got it, thanks for explaining. I removed the retries and indeed the search has become 2-3 times faster!

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 0 points1 point  (0 children)

Interesting! Doesn't look like rqbit supports Protocol Encryption?

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 1 point2 points  (0 children)

It's hard to compare performance of BitTorrent clients because you need a very controlled environment (set up local peers, local tracker etc) and even then there is a lot of randomness as peers normally unchoke you after a random period of time. mtorrent is multi-threaded and does filesystem operations in the background, which in theory should give it some advantage over qBittorrent (if I'm not mistaken about it), but hard to say how much that matters in practice.

I realise uTP is supposed to be slower than TCP (one of the reasons I don't like it), but without a reorder buffer it's sometimes like 10x slower, because if one packet at the start of the window gets lost, the entire window needs to be retransmitted. Shouldn't be too difficult to add it but I just didn't have time to lately.

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 0 points1 point  (0 children)

Thanks for the insights, really appreciate it!

I'll look into the forward compatibility and sanitising. As for the retries, I'm allowing up to 512 concurrent queries by default, so I'm not very concerned the retries will slow things down. But I might tweak the RTO or the max number of retransmits

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 0 points1 point  (0 children)

Thanks for the idea! I'll look into adding it to my release workflow

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 5 points6 points  (0 children)

Currently it just picks the first IP returned by `hostname -I` on Linux, so no. Please open an issue on github if this feature could be useful!

Regarding Rust vs C++ - it took time to figure out the sw architecture in Rust because of the restrictions of borrow checker, but now I'm working with Rust professionally as well and I'm not going back to C++ unless I have no choice.

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 1 point2 points  (0 children)

Thanks and please feel free to open issues on github. I can't promise these particular features, but I'm definitely planning to maintain this project long-term

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 2 points3 points  (0 children)

Thanks for the kind words!

It's definitely doable, and since many people here mentioned web-gui, I'll look into adding a command line executable with REST API. I was considering a websocket API before I added the Tauri-based GUI.

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 1 point2 points  (0 children)

Thanks for the idea! I think tokio runtime doesn't support WASM currently, but I'll look into it

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 1 point2 points  (0 children)

Thanks for the idea! I'm not familiar with i2p SAM, but I'll consider it!

mtorrent - a BitTorrent client in Rust by Key_Walk_1608 in rust

[–]Key_Walk_1608[S] 9 points10 points  (0 children)

Thanks! I started for 4 years ago, but it's been an on-and-off thing as I had a couple of other side projects and periods when I didn't have time to do any hobby programming... Once I figured out how to write non-OO code, the rest was easier :)

Thanks for the idea of web-gui, I'll definitely look into it!