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

Spec for SocketOptions.SO_BINDADDR incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 6
    • core-libs
    • b18
    • generic
    • generic
    • Verified

      The specification for SocketOptions.SO_BINDADDR has some legacy wording:

      "Fetch the local address binding of a socket (this option cannot be "set" only "gotten", since sockets are bound at creation time, and so the locally bound address cannot be changed)."

      The statement "socket are bound at creation time" appears to be out-dated. Since 1.4 it has been possible to create unbound sockets so this means the socket will not be bound until the socket is connected or explicitly bound.

      The statement "the locally bound address cannot be changed" should probably be expanded upon to. While the address can't be changed explicily, it can be changed implicitly - eg: bind a DatagramSocket to the wildcard address and then connect it to a remote address. In that case the local address will change to a specific address while the socket is connected. If the socket is disconnected then the local address be again be reported as the wildcard address.

            jpai Jaikiran Pai
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: