8221252: (sc) SocketChannel and its socket adaptor need to handle connection reset
Brian Burkhalter
brian.burkhalter at oracle.com
Thu Mar 21 21:50:43 UTC 2019
> On Mar 21, 2019, at 5:33 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> This is, I hope, the last patch in the series to prepare the code in sun.nio.ch <http://sun.nio.ch/> for the NIO based SocketImpl. This last patch mostly concerns the behavior when reading after a connection reset has been detected. […]
>
> The webrev with the changes is here. The new test exercises SocketChannel.read and the socket adaptor read/available methods for cases where the connection is reset.
>
> http://cr.openjdk.java.net/~alanb/8221252/webrev/ <http://cr.openjdk.java.net/~alanb/8221252/webrev/>
I don’t see any problems here. Some minor nits:
* Copyright year needs to be updated in IOStatus, UnixAsynchronousSocketChannelImpl, and SctpChannelImpl.
* ConnectionReset test:
— Maybe interchange lines 32 and 33.
— I suppose the println() calls which are the first statements in the test methods could be removed.
— The test method names might be slightly more descriptive, e.g, testSocketChannelReadNoBytes (or testSocketChannelReadNull) and testSocketChannelReadBytes (or testSocketChannelRead) instead of testSocketChannelRead1 and testSocketChannelRead2, respectively.
— Typos: line 99 “connectin” -> “connection” and line 188 “teh” => “the”
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190321/40a83e47/attachment.html>
More information about the nio-dev
mailing list