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

DatagramSocket / DatagramChannel do not specify what happens when sending to port 0

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None

      Description

      The behavior of DatagramSocket / DatagramChannel send method when the target address is specified to port 0 appears to be system dependent:

      on Linux / macOS: an IOException is thrown.
      on Windows / Solaris: no exception is thrown.

      Whether the spec and implementation should be changed to always throw IllegalArgumentException instead should be examined.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dfuchs Daniel Fuchs
              Reporter:
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: