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

Add suffix to protocol specific Socket methods #519

Open
Thomasdezeeuw opened this issue Jun 19, 2024 · 0 comments
Open

Add suffix to protocol specific Socket methods #519

Thomasdezeeuw opened this issue Jun 19, 2024 · 0 comments

Comments

@Thomasdezeeuw
Copy link
Collaborator

We currently split all methods in different impl blocks with documentation to indicate what kind of socket level the method operates on, e.g. SOL_SOCKET or IPPROTO_IP.

However in some cases a socket option can be used with multiple protocols, e.g. IP_HDRINCL, this can lead to confusing error as seen in #517.

I propose we add a suffix to all not SOL_SOCKET methods. For example:

  • SOL_SOCKET -> none,
  • IPPROTO_IP -> _v4,
  • IPPROTO_IPV6 -> _v6,
  • IPPROTO_TCP -> _tcp,
  • IPPROTO_UDP -> _udp.

The methods will be a bit more annoying to call, but at least it will result in less errors.

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

1 participant