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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0, 14
    • 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.

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

              Created:
              Updated:
              Resolved: