RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Pavel Rappo
Hi everyone, Could you please review my change for JDK-8024832? http://cr.openjdk.java.net/~prappo/8024832/webrev.00/ Thanks -Pavel

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Michael McMahon
On 27/05/14 10:40, Pavel Rappo wrote: Hi everyone, Could you please review my change for JDK-8024832? http://cr.openjdk.java.net/~prappo/8024832/webrev.00/ Thanks -Pavel Just wondering, what does ServerSocket.accept() throw in the same situation? Michael

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Chris Hegarty
Looks good to me Pavel. I can sponsor this change for you. -Chris. On 27 May 2014, at 10:40, Pavel Rappo wrote: > Hi everyone, > > Could you please review my change for JDK-8024832? > > http://cr.openjdk.java.net/~prappo/8024832/webrev.00/ > > Thanks > -Pavel

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Michael McMahon
I think it should be throwing a SocketException rather than a NotYetBoundException to be consistent with ServerSocket.accept() Michael. On 27/05/14 10:56, Chris Hegarty wrote: Looks good to me Pavel. I can sponsor this change for you. -Chris. On 27 May 2014, at 10:40, Pavel Rappo wrote: Hi

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Alan Bateman
On 27/05/2014 10:40, Pavel Rappo wrote: Hi everyone, Could you please review my change for JDK-8024832? http://cr.openjdk.java.net/~prappo/8024832/webrev.00/ Can you try just removing the isBound check? I ask because ssc.accept() will throw NotYetBoundException if the ServerSocketChannel is n

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Pavel Rappo
Michael, java.net.ServerSocket.accept: if (!isBound()) throw new SocketException("Socket is not bound yet"); sun.nio.ch.ServerSocketAdaptor.accept will translate java.nio.channels.NotYetBoundException into an instance of SocketException with the text you see above. Basically that's

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Michael McMahon
Okay, that's fine then. I didn't see the call to the translation method in the diff. Thanks, Michael. On 27/05/14 11:05, Pavel Rappo wrote: Michael, java.net.ServerSocket.accept: if (!isBound()) throw new SocketException("Socket is not bound yet"); sun.nio.ch.ServerSocketAdapt

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Pavel Rappo
Alan, I don't think it would be exactly the same behaviour since there's a conditional check (1) before the ssc.accept call: try { if (!ssc.isBound()) throw new NotYetBoundException(); (1) if (timeout == 0) { Socket

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Alan Bateman
On 27/05/2014 11:19, Pavel Rappo wrote: Alan, I don't think it would be exactly the same behaviour since there's a conditional check (1) before the ssc.accept call: try { if (!ssc.isBound()) throw new NotYetBoundException(); (1) i

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread mark . reinhold
2014/5/26 20:01 -0700, michael.x.mcma...@oracle.com: > I think it should be throwing a SocketException rather than a > NotYetBoundException to be consistent with ServerSocket.accept() No, NotYetBoundException is the correct exception here. The NIO exception hierarchy was intentionally designed to

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread mark . reinhold
2014/5/27 1:10 -0700, michael.x.mcma...@oracle.com: > On 27/05/14 15:56, mark.reinh...@oracle.com wrote: >> 2014/5/26 20:01 -0700, michael.x.mcma...@oracle.com: >>> I think it should be throwing a SocketException rather than a >>> NotYetBoundException to be consistent with ServerSocket.accept() >>

Re: RFR JDK-8024832: (so) ServerSocketChannel.socket().accept() throws IllegalBlockingModeException if not bound

2014-05-27 Thread Michael McMahon
On 27/05/14 15:56, mark.reinh...@oracle.com wrote: 2014/5/26 20:01 -0700, michael.x.mcma...@oracle.com: I think it should be throwing a SocketException rather than a NotYetBoundException to be consistent with ServerSocket.accept() No, NotYetBoundException is the correct exception here. The NIO