RFR: JDK-8337974 - ChannelInputStream::skip can use splice (linux)

Markus KARG duke at openjdk.org
Sat Sep 21 15:49:36 UTC 2024


On Tue, 13 Aug 2024 11:08:11 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> I think the Socket and Pipe changes need to be separated and the merits of each discussed separately.

I understand your intention, and that should be possible on Linux, but on Windows this is impossible as the Pipe implementation on Windows actually is just a wrapper around the Socker implementation. As all OS share common code, in fact I do not see the possibility to separate Sockets and Pipes hence. Possible I missed an obvious solution to that interrelation, then please tell me.

> Starting with the changes to improve InputStream.skip when connected to a socket seems okay. There are two implementations, one is the SocketImpl implementation used by the Socket API (not changed here), the other is implementation returned by SocketChannel::socket which is changed here. It seems plausible that improving skip will help some use-cases. My initial reaction to touching this area is that will likely require clarifications to the specification of Socket.getInputStream, e.g. this method doesn't specify how show skip behaves when a timeout is set, doesn't specify IllegalBlockingModeException when the channel is non-blocking, and doesn't specify how it behaves when the Thread is interrupted.

Thank you for your kind review. I will look into adding some JavaDocs to better express the behavior of the changed classes.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20489#issuecomment-2365232471


More information about the nio-dev mailing list