RFR: 8189366: SocketInputStream.available() should check for eof
Martin Buchholz
martinrb at google.com
Thu Oct 26 16:01:25 UTC 2017
Any change that fiddles with "available" is never simple!
I confess to not understanding sockets, but intuitively they differ from
files in that eof is a murky concept - there may not be any data from the
other end of the socket right now, but who knows what's coming soon?
What's the difference between eof and closed?
Even for files eof might be murky - if some other process is writing to a
file in append mode, eof might be a transient state.
On Thu, Oct 26, 2017 at 2:26 AM, vyom tewari <vyom.tewari at oracle.com> wrote:
> Hi All,
>
> Please review the simple change below.
>
> Webrev : http://cr.openjdk.java.net/~vtewari/8189366/webrev0.0/index.
> html
>
> BugId : https://bugs.openjdk.java.net/browse/JDK-8189366
>
>
> Currently SocketInputStream.available() does not check for "eof" and
> simply delegate to the impl even when "eof" reached. I put a check to
> return 0 if "eof" is already reached.
>
> Thanks,
>
> Vyom
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20171026/195c9dd8/attachment.html>
More information about the net-dev
mailing list