RFR: 8189366: SocketInputStream.available() should check for eof
David Lloyd
david.lloyd at redhat.com
Thu Oct 26 20:37:59 UTC 2017
On Thu, Oct 26, 2017 at 4:44 AM, Bernd Eckenfels <ecki at zusammenkunft.net> wrote:
> What is currently returned at the end of a stream? This looks like a
> dangerous thing to do, if a existing implementation only read when something
> is available it might never detect that it reached EOF.
At present it ultimately delegates (on UNIXy) to ioctl(fd, FIONREAD,
xxx) which I guess will return an errno in this case. If that's the
case then I agree that returning 0 is a smarter option.
--
- DML
More information about the net-dev
mailing list