RE: 8217461: (ch) Add Net.available to return the number of bytes in the socket input buffer

2019-01-22 Thread Langer, Christoph
Hi Alan, the change looks good to me. In src/java.base/unix/native/libnio/ch/Net.c and src/java.base/windows/native/libnio/ch/Net.c you could change the code from ... int n = NET_SocketAvailable(fdval(env, fdo), &count); if (n != 0) { ... to one line if (NET_SocketAvailable(fdval(env, fdo), &c

Re: 8217461: (ch) Add Net.available to return the number of bytes in the socket input buffer

2019-01-22 Thread Michael McMahon
Looks fine to me Alan. - Michael. On 21/01/2019, 19:10, Alan Bateman wrote: This is a small change to add a method to sun.nio.ch.Net to get the number of bytes in the socket input buffer. The motive for adding this to make it possible for the socket adaptors to implement InputStream::availabl

Re: 8217461: (ch) Add Net.available to return the number of bytes in the socket input buffer

2019-01-22 Thread Alan Bateman
On 22/01/2019 08:07, Langer, Christoph wrote: Hi Alan, the change looks good to me. In src/java.base/unix/native/libnio/ch/Net.c and src/java.base/windows/native/libnio/ch/Net.c you could change the code from ... int n = NET_SocketAvailable(fdval(env, fdo), &count); if (n != 0) { ... to o