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 #2280: Add Unix-only IPv6 TCP support to javalib #2823
Fix #2280: Add Unix-only IPv6 TCP support to javalib #2823
Conversation
I believe that support for Windows could be provided by someone with knowledge. I believe Over the course of the next few months, I hope to get a Windows development environment |
I believe that support for Windows could be provided by someone with knowledge. I believe Over the course of the next few months, I hope to get a Windows development environment |
val prop = System.getProperty("java.net.preferIPv4Stack") | ||
val useIPv4 = (prop != null) && (prop.toLowerCase() == "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really important but we can use sys.SystemProperties.preferIPv4Stack.value
here. Just a tip for future usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can retrace the sys.SystemProperties.preferIPv4Stack path again. I usually like single points
of implementation. Either I found the sys.systemProperties after I wrote this. My memory
is that there is a subtlety about the time the (lazy?) val is evaluated. The present code
is pretty sure to evaluate when the first Socket is accessed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to do thing right the first time, but this whole initialization is subject to "appropriate precision".
That is, it is almost certain that likely change will overwhelm & obliterate putting too fine a point on
this initialization in particular.
Thank you for the merge.
For future reference: Lee: double-check when the Scala |
We add IPv6 TCP, a.k.a streaming, support to javalib net on Unix-like systems.
This allows Scala Native programs using javalib TCP sockets to use a more efficient
network protocol.
This capability will probably be most used by programs ported from JVM or ScalaJVM.
posixlib sockets offer much finer control with less internal overhead.
The "Java Standard Library" section of the ReadTheDocs Scala Native documentation
is updated in the PR and provides the best description of the new IPv6 support.
The TL;DR is that if a Scala Native JVM program is using IPv6 successfully, then
that program should work with this new IPv6 support.
This work follows the two decade long precedent of the JVM in silently
enabling the use of IPv6 if any network interface, other than the loopback
interface, is configured for IPv6. Programs can execute code to
disable that default enabling.
This PR incorporates the changes from two network related PRs that
were merged in the 0.4.x stream.
It has benefited from review and discussion in WIP PR #2484, which
it supersedes.