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

DatagramSocket ctor spec and ::getLocalAddress spec are mismatching

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 15
    • core-libs

      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.

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

              Created:
              Updated:
              Resolved: