Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234756

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

    Details

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

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: