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

DatagramSocket constructors accepting port number deserve to specify behavior for zero port passed

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Duplicate
    • 15
    • None
    • core-libs

    Description

      There are two DatagramSocket ctors accepting port number.
      One of them even has "The local port must be between 0 and 65535 inclusive" assertion.

      It turns out that "A port number of zero will let the system pick up an ephemeral port in a bind operation" - assertion from the InetSocketAddress constructor used by the implementation.

      Would be good for DatagramSocket ctors to specify that zero port number tells the system to pick any appropriate port number.

      Attachments

        Issue Links

          Activity

            People

              pconcannon Patrick Concannon (Inactive)
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: