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

sockets: prototype for ipv6 #47

Merged
merged 7 commits into from
Feb 14, 2024
Merged

sockets: prototype for ipv6 #47

merged 7 commits into from
Feb 14, 2024

Conversation

alaviss
Copy link
Owner

@alaviss alaviss commented Jul 18, 2023

With the current prototype, I'm opting for keeping the transport protocol address family agnostic. This means that variants have to be used to distinguish between IPv4 and IPv6 addresses, but simplifies the typical usage of data transport drastically by not requiring strict type disambiguation.

I might revisit making TCP4/TCP6 sockets a thing when a form of polymorphism exists for the language.

Breaking changes:

  • resolveIP4 -> resolveIP
  • addressing APIs now return IPEndpoint, which could be either IP4 or IP6 endpoint

Implementation status:

  • Platforms
    • POSIX
    • Windows

Blocked by: nim-works/cps#301 Fixed with CPS 0.10.1

@alaviss alaviss mentioned this pull request Jul 18, 2023
24 tasks
@alaviss alaviss force-pushed the features/sockets-v6 branch 3 times, most recently from 08d1822 to b59cde6 Compare February 11, 2024 16:00
@alaviss alaviss marked this pull request as ready for review February 14, 2024 04:54
With the current prototype, I'm opting for keeping the transport protocol
address family agnostic. This means that variants have to be used to distinguish
between IPv4 and IPv6 addresses, but simplifies the typical usage of data transport
drastically by not requiring strict type disambiguation.

I might revisit making TCP4/TCP6 sockets a thing when a form of polymorphism exists
for the language.

Breaking changes:

- resolveIP4 -> resolveIP
- addressing APIs now return IPEndpoint, which could be either IP4 or IP6 endpoint
This fixes the bug regarding object variant usage
Nim stdlib definition is inconsistent between OS, so we fix it here.
NimSkull doesn't bode well with `.type`, switching to `type()` seems to work
For OS/Arch other than linux/amd64, these are importc-ed and cannot be used in static context.

Switch to if to get them working.
@alaviss alaviss merged commit 008078b into master Feb 14, 2024
25 checks passed
@alaviss alaviss deleted the features/sockets-v6 branch February 14, 2024 08:50
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.

1 participant