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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: