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

Support IPV6_ADDR_PREFERENCES until Java 24 and beyond #1007

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

bertm
Copy link
Contributor

@bertm bertm commented Nov 19, 2024

While reflection on Java's internals is slowly being crippled, Unsafe access is still possible (at least until JEP 417 [0] reaches phase 3 in Java 26 or later).

This requires moving from DatagramSocket to DatagramChannel as the former is substantially rewritten in Java 15 (JEP 373, see [1]) as a wrapper around the latter. The channel-based socket cannot be used in Java versions prior to 14 due to Java bug JDK-8232673 [2] which prevents read/write concurrency, effectively stalling the node.

Tested on OpenJDK 8, 11, 17, 21, 23, and 24.
Fixes bug 07217.

[0] https://openjdk.org/jeps/471
[1] https://openjdk.org/jeps/373
[2] https://bugs.openjdk.org/browse/JDK-8232673

While reflection on Java's internals is slowly being crippled, Unsafe
access is still possible (at least until JEP 417 [0] reaches phase 3 in
Java 26 or later).

This requires moving from DatagramSocket to DatagramChannel as the
former is substantially rewritten in Java 15 (JEP 373, see [1]) as a
wrapper around the latter. The channel-based socket cannot be used in
Java versions prior to 14 due to Java bug JDK-8232673 [2] which prevents
read/write concurrency, effectively stalling the node.

Tested on OpenJDK 8, 11, 17, 21, 23, and 24.
Fixes bug 07217.

[0] https://openjdk.org/jeps/471
[1] https://openjdk.org/jeps/373
[2] https://bugs.openjdk.org/browse/JDK-8232673
Copy link
Contributor

@ArneBab ArneBab left a comment

Choose a reason for hiding this comment

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

Looks good to me

@ArneBab
Copy link
Contributor

ArneBab commented Nov 30, 2024

Merged — thank you!

@ArneBab ArneBab merged commit a9b18be into hyphanet:next Nov 30, 2024
1 check passed
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.

2 participants