-
Notifications
You must be signed in to change notification settings - Fork 361
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
feature: javalib java.net.channel.DatagramChannel #3910
base: main
Are you sure you want to change the base?
Conversation
...ared/src/test/scala/org/scalanative/testsuite/javalib/nio/channels/DatagramChannelTest.scala
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,5 @@ | |||
package java.net | |||
|
|||
trait ProtocolFamily { |
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 do not see this in the JDK java.net
documentation, so probably
needs to be private, probably private[net]
(I believe that one can have private traits).
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.
It is part of the java public API
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.
Today I learned... Thank you for the URL, got any kitchen sinks hidden in there?
@@ -505,3 +511,19 @@ private[net] object ip6 { | |||
def IPV6_MULTICAST_HOPS: CInt = in.IPV6_MULTICAST_HOPS | |||
} | |||
} | |||
|
|||
@extern | |||
object async { |
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 think this should be private[net]
also. See the declaration just above.
In a better world, or at least more consistent world SocketHelpers
would also be private. I believe it is not here because something
in unit-tests
reaches into SocketHelpers
and executes a method.
No one, including me, has gotten around to removing that wart.
I'll have to dive deeper into the concepts here later (days).
val dc = DatagramChannel.open() | ||
try { | ||
f(dc) | ||
} finally { |
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.
Nice to see channel getting closed on both success and exception paths. We have a lot of technical debt in SN with resources (files) not getting closed when an assertion fails.
RustedBones, You have done a lot of work here & the improvement shows. My CI run finished and my pillow is calling so I can not do more tracing tonight. From what I have seen so far this approach is promising enough that I will spend more time studying it. Across the board, it seems like some of the new, non-JVM classes need to be private. (private [net]). |
cb84f6b
to
03596c9
Compare
First step for #3676 with DatagramChannel.
Implementation of
java.nio.channels
classes based on previous work done in #978Creation of a
Net
helpers to factorize code between socket and channels.