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

Alan Bateman Alan.Bateman at oracle.com
Sat Feb 21 08:38:20 UTC 2015


On 20/02/2015 22:30, Brian Burkhalter wrote:
> Please review at your convenience.
>
> Issue:	https://bugs.openjdk.java.net/browse/JDK-8071599
> Patch:	http://cr.openjdk.java.net/~bpb/8071599-8u/webrev.00/
>
> Summary: allow MSG_OOB (out-of-band byte) to be sent on the Socket associated with a SocketChannel when the Socket is in non-blocking mode. All JPRT tests pass as well as does a test which verifies that the intended objective of the change has been achieved.
>
> Yes, I am aware that the copyright years need to be updated.
>
> This request is being made directly to the JDK-8u60 project but is intended to be ported forward to the JDK 9 project in short order.
>
I think we should agree the changes JDK 9 before thinking about 8uX.

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.

-Alan.


More information about the nio-dev mailing list