[8u60] RFR of 8071599: (so) Socket adapter sendUrgentData throws IllegalBlockingMode when channel configured non-blocking

Chris Hegarty chris.hegarty at oracle.com
Mon Feb 23 11:14:03 UTC 2015


On 21/02/15 08:38, Alan Bateman wrote:
> ...
> Do you really need to change SocketChannel? The simplest way to support
> the request is to drop the blocking lock from the socket adaptor's
> sendUrgentData method. If the socket buffer is full then you
> sc.sendOutOfBandData will throw an IOException or will return 0 (it's
> platform specific but just checking for a 0 return should be
> sufficient). I think this would be a lot simpler than passing the
> blocking mode down to the native level.

I think it was me that suggested to Brian, off-list, to pass the boolean 
blocking mode down to the native layer. Doing this will return an 
IOException with a consistent detail message on all platforms. If we do 
not do this, and leave it to convertReturnVal, then an IOException will 
still be raised, but it may have a different detail message on different 
platforms. I don't have a strong preference either way.

Otherwise, I'm happy to see this go into JDK 9, with a possible backport 
at some point in the future.

-Chris.


> -Alan.


More information about the nio-dev mailing list