[8u60] RFR of 8071599: (so) Socket adapter sendUrgentData throws IllegalBlockingMode when channel configured non-blocking
Alan Bateman
Alan.Bateman at oracle.com
Mon Feb 23 21:54:10 UTC 2015
On 23/02/2015 21:11, Brian Burkhalter wrote:
>
> On Feb 23, 2015, at 3:14 AM, Chris Hegarty <chris.hegarty at oracle.com
> <mailto:chris.hegarty at oracle.com>> wrote:
>
>> 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.
>
> This is exactly the point: this approach gives complete consistency
> across all platforms but at the expense of a little extra code complexity.
>
You will also get consistent behavior just check for 0 in SocketAdaptor
with the advantage that you don't drop the platform specific message
(which can be useful when in other locales). However it is corner case
so not worth spending time on.
So if you are changing SocketChannel to use isBlocking then it would be
good to put add assert Thread.holdsLock(blockingLock()) in
sendOutOfBandData to check that the lock is held. The changes otherwise
look okay. In the SendUrgentData.java test then you might want to move
up the @test tag to match the other tests.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150223/239eab06/attachment.html>
More information about the nio-dev
mailing list