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

DatagramSocket ctor spec and ::getLocalAddress spec are mismatching

    XMLWordPrintable

Details

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

    Description

      DatagramSocket()

      "Constructs a datagram socket and binds it to any available port on the local host machine . The socket will be bound to the wildcard address, an IP address chosen by the kernel"

      ::getLocalAddress()
      "Returns: or an InetAddress representing wildcard address if either the socket is not bound, or the security manager checkConnect method does not allow the operation"

      As the constructor spec says - the socket IS bound and calling ::getLocalAddress()::isAnyLocalAddress() hints that it's really a wildcard address.

      ::getLocalAddress() spec deserves correction/clarification/update.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: