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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      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.

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

              Created:
              Updated:
              Resolved: