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

Alan Bateman Alan.Bateman at oracle.com
Mon Jan 21 19:10:04 UTC 2019


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::available and also to support an alternative SocketImpl 
based on NIO. I've used the opportunity to clean up NET_SocketAvailable 
in libnet so that it returns 0 when it succeeds.

The proposed changes are here:
   http://cr.openjdk.java.net/~alanb/8217461/webrev/index.html

-Alan


More information about the net-dev mailing list