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

Fix up SocketAddress #1910

Open
Lukasa opened this issue Jul 22, 2021 · 0 comments
Open

Fix up SocketAddress #1910

Lukasa opened this issue Jul 22, 2021 · 0 comments
Labels
⚠️ needs-major-version-bump For PRs that when merged cause a bump of the major version, ie. x.0.0 -> (x+1).0.0
Milestone

Comments

@Lukasa
Copy link
Contributor

Lukasa commented Jul 22, 2021

As discussed somewhat in #1907, SocketAddress is a fairly painful type with a very awkward API surface. It has a prominent place in the API, one that is very difficult to reconcile with the way modern networks function (see #508). That prominent place also interacts awkwardly with that reality, as SocketAddress prominently uses the sockaddr_* types and is wedded to the decisions those types make.

There are a number of ways this could be made better in a future version:

  1. Stop storing things in C types.

    While NIO requires that we be able to produce C types, we don't need to store things there! This would let us improve the layout of the type, and take advantage of any work done as part of Provide IPAddress type #1650. This would also address C system types are exposed, which may be incompatible #1673.

  2. Stop exposing C flags for address family.

    The distinction between address families does not need to be part of the API of this type, and you certainly don't need to be able to produce a wrapper for SOCK_STREAM from this. We should let NIOBSDSocket be responsible for managing that, not us.

@Lukasa Lukasa added the ⚠️ needs-major-version-bump For PRs that when merged cause a bump of the major version, ie. x.0.0 -> (x+1).0.0 label Jul 22, 2021
@Lukasa Lukasa added this to the 3.0.0 milestone Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ needs-major-version-bump For PRs that when merged cause a bump of the major version, ie. x.0.0 -> (x+1).0.0
Projects
None yet
Development

No branches or pull requests

1 participant