8231259: (dc) DatagramChannel::disconnect re-binds socket to the wildcard address (macOS)

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 19 10:59:05 UTC 2019


On 19/11/2019 09:54, Chris Hegarty wrote:
> :
> 1) The new dup2 wrapper around the native call seems more suited to sun.nio.ch.Net, rather than an instance method on DCI.
sun.nio.ch.Net is network so not the right place. We should potentially 
move it to NativeDispatcher, didn't seem to be worth doing as part of 
this change but I can do.

>
> 2) Why change disconnect0 from a static method to an instance method? The implementation does not need access to the DCI instance? Same for dup2, as above.
The native methods were originally written as instance methods, second 
parameter is a jobject. All I've done is fix the declaration to match 
the method. I have other changes come that will replace the receive0 
method and that would be a good time to change the methods to be static, 
otherwise we would have a mix of static and instance that leads to the 
mistakes like disconnect0.

>
> 3) Hmm... I’m not sure of the appropriateness of putting an Apple bug number in source code comments? It looks very weird to me. Has similar been done before? ( it should be good enough to have such in JIRA )
>
Fair point, I can remove that from the comment.

-Alan


More information about the nio-dev mailing list