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

WIP: accept tracker connections #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

laur89
Copy link
Contributor

@laur89 laur89 commented Feb 3, 2023

Note this change is on top of #172 -- merge that beforehand.
merged

@laur89 laur89 force-pushed the accept-tracker-connections branch 4 times, most recently from 852c04f to ad725e2 Compare February 3, 2023 06:31
@laur89 laur89 changed the title Accept tracker connections WIP: accept tracker connections Feb 3, 2023
@laur89 laur89 force-pushed the accept-tracker-connections branch 2 times, most recently from a0b0f80 to dc0797b Compare February 7, 2023 15:33
selector.select();
for (SelectionKey key : selector.selectedKeys()) {
if (key.isAcceptable()) {
this.listenChannel.accept();
Copy link
Contributor Author

@laur89 laur89 Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note no I/O is done here at the moment, we only accept the connection. Any ideas how to proceed, if at all?

Copy link
Owner

@anthonyraymond anthonyraymond Feb 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The macro vision is:

  • When a peer connect though bittorrent protocol => send a choke message

But "connect through bittorrent protocol" is easier said than done 😆 .

it's something related to : https://github.com/mpetazzoni/ttorrent/blob/2c8bb62f9f69b74c014358d446554df96ec91c7c/ttorrent-client/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java#L148

Instead of adding peers to whatever store you'll just choke them (maybe close connection?).

This feature require a deep comprehension of the peer section of BitTorrent RFC (and also to investigate the source code of libtorrent and other OpenSource clients to understand how they individualy do their job).

@laur89
Copy link
Contributor Author

laur89 commented Feb 16, 2023

Ye this is going to need quite a bit of research/know-how.
Would you be willing to merge this as-is, considering it's reportedly solved problem to one user. And possibly/hopefully it improves existing logic somewhat.

@WZrocks
Copy link

WZrocks commented Mar 19, 2023

Ye this is going to need quite a bit of research/know-how. Would you be willing to merge this as-is, considering it's reportedly solved problem to one user. And possibly/hopefully it improves existing logic somewhat.

Two users. :-) I have been waiting for this merge, and updated Docker image, since the opening of this PR.

@anthonyraymond
Copy link
Owner

Hello there, i've not forgotten about you.

But i'm lacking time to review that. I try to give it a look ASAP

@WZrocks
Copy link

WZrocks commented May 8, 2023

Do you have any idea if and when you'll have the time to look at this, @anthonyraymond? I don't want to rush you, I'm already very grateful for what you did with this project so far, I'm just looking for an ETA.

@anthonyraymond
Copy link
Owner

anthonyraymond commented May 9, 2023

Hello,
i'm still unsure if i want to merge this as-is or not. Not sure if that makes its more unsafe or not.

An analogy for this PR is:

  • before nobody won't ever answer the call when the phone rings.
  • Now someone will, but he is clearly not speaking the language that you expect the people to speak. You'll know it's not the person it is supposed to be on the other end.

@WZrocks
Copy link

WZrocks commented May 10, 2023

That is a valid point. Would it be possible to make it optional in config? @laur89 @anthonyraymond

@rursache
Copy link

rursache commented May 26, 2023

@anthonyraymond i think it's best to just add a toggle in settings. for me it works great but maybe others can have issues, indeed. can't wait to see this merged and published <3

@WZrocks
Copy link

WZrocks commented Jun 26, 2023

I don't think the config option will come anytime soon either, right? 😔

@rursache
Copy link

rursache commented Nov 1, 2023

@anthonyraymond can we please merge this as well? been using it since then and it's all good. maybe add a config toggle in the settings just in case?

@anthonyraymond
Copy link
Owner

anthonyraymond commented Nov 2, 2023

@rursache i don't think this is ever going to be added as is. It's sounds a bit dangerous for most people.

I'll include a real and complete implementation in the next version (built from scratch), but for now i prefer not to include it as is

@rursache
Copy link

rursache commented Nov 2, 2023

@anthonyraymond
I'll include a real and complete implementation in the next version (built from scratch), but for now i prefer not to include it as is

thank you, looking forward to your implementation!

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

Successfully merging this pull request may close these issues.

4 participants