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

DhtEndPoint and ListenEndPoint xmldocs summary needs to be updated #609

Open
ManlyMarco opened this issue Jan 26, 2023 · 2 comments
Open

Comments

@ManlyMarco
Copy link

ManlyMarco commented Jan 26, 2023

The type was changed from int to EngineSettingsBuilder.DhtEndPoint, but documentation still assumes it's an int and is confusing (it mentions -1 and 0 magic numbers). Exists on latest master branch.

Edit: The same is true for ListenEndPoints.
Edit2: I just realized you need to put ipv4 or ipv6 in the Key of ListenEndPoints, empty string won't work. Wouldn't it be better to use an enum for Key of ListenEndPoints to avoid mistakes like this?

@ManlyMarco ManlyMarco changed the title DhtEndPoint xmldocs summary needs to be updated DhtEndPoint and ListenEndPoint xmldocs summary needs to be updated Jan 26, 2023
@jpmikkers
Copy link
Contributor

jpmikkers commented Feb 1, 2023

Also, why is EngineSettingsBuilder.ListenEndPoints a dictionary? IPEndPoint knows if its ipv4 or ipv6 right.

@alanmcgovern
Copy link
Owner

alanmcgovern commented Feb 6, 2023

Also, why is EngineSettingsBuilder.ListenEndPoints a dictionary? IPEndPoint knows if its ipv4 or ipv6 right.

There's a mix of a few things going on here

  • There was a usecase in the past for an external implementation of an ITracker, which then had to be registered with the engine, and so the ability to register an arbitrary uri prefix to a particular ITracker (or ITrackerConnection) implementation was useful.
  • Consistency across APIs. Trackers can be ipv4 or ipv6, and also UDP or HTTP. As such, the AddressFamily alone isn't enough, they'll need an extra property to disambiguate.
  • Peer connections can be ipv4 or ipv6 and also TCP or uTP if I ever implement that. Similar to trackers, peer connections would need more than just the IP address.

TBH, I think i'll restructure things similar to what you're both suggesting and not make things overly complex for everyone.

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

3 participants