(dc spec) DatagramChannel.read should not specify that it returns -1 at EOF

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.4.0, 14
    • Component/s: core-libs

      The read methods defined by DatagramChannel inherit javadoc from ReadableByteChannel that specifies that -1 is returned when the channel is at EOF. There is no concept of EOF in DatagramChannel. However, they do return -1 when a zero-length datagram is received. This is long standing and unspecified behavior that, by accident, allows a caller to distinguish it from the non-blocking case where there are datagrams available.

            Assignee:
            Brian Burkhalter
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: