Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-29 Thread Alan Bateman
On 29/03/2018 15:05, Chris Hegarty wrote: : Good catch. The !ipv6_supported case has been updated to close the socket and set the fd to null. Given that the cleaner is unregistered, and the fd is null ( close will effectively be a no-op ), it should be fine. http://cr.openjdk.java.net/~chegar/82

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-29 Thread Chris Hegarty
> On 29 Mar 2018, at 11:47, Daniel Fuchs wrote: > ... > I wonder if the class could be marked final? > All these bind0 method are protected, which > raises the question of what would happen if they are > overridden in a subclass. I will make it final. > On 29 Mar 2018, at 11:43, Alan Bateman w

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-29 Thread Alan Bateman
On 29/03/2018 11:10, Chris Hegarty wrote: : This is much simpler. @Override protected synchronized void bind0(int lport, InetAddress laddr) throws SocketException { + // The native bind0 may close one or both of the underlying file + // descr

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-29 Thread Chris Hegarty
> On 28 Mar 2018, at 20:47, Chris Hegarty wrote: > ... > Right, unconditionally unregistering and re-registering would be easier > to follow, and then try-finally would not be required either. I’ll try this, > test it, and report back. This is much simpler. @Override protected sy

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-28 Thread Chris Hegarty
> On 28 Mar 2018, at 19:47, Roger Riggs wrote: > > Hi Chris, > > TwoStacksPlainDatagramSocketImpl.java:136 could be explicit about the native > bind0 > changing the state. Ok. > And I agree with Alan that the calls to updateCleaner (:144) should occur > whether or not > the native bind0 thr

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-28 Thread Roger Riggs
Hi Chris, TwoStacksPlainDatagramSocketImpl.java:136 could be explicit about the native bind0 changing the state. And I agree with Alan that the calls to updateCleaner (:144) should occur whether or not the native bind0 throws an exception. Thanks, Roger On 3/28/2018 1:22 PM, Alan Bateman w

Re: RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-28 Thread Alan Bateman
On 28/03/2018 10:08, Chris Hegarty wrote: 8195059 [1] updated the socket implementation to use a cleaner, rather than the previous finalizer implementation. Unfortunately the TwoStacksPlainDatagramSocketImpl on Windows, that uses two native file descriptors, may close one or other when binding, o

RFR [11] 8200304: TwoStacksPlainDatagramSocketImpl and socket cleaner

2018-03-28 Thread Chris Hegarty
8195059 [1] updated the socket implementation to use a cleaner, rather than the previous finalizer implementation. Unfortunately the TwoStacksPlainDatagramSocketImpl on Windows, that uses two native file descriptors, may close one or other when binding, or it may in fact close both sockets and crea