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

(dc) DatagramChannel::disconnect changes the port of the local address to 0 (lnx)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 14
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b18
    • OS:
      linux

      Description

      On linux, after calling DatgramChannel::disconnect, DatagramChannel::getLocalAddress reports a soclet address with a local port set to 0.
      This appears to be a known side effect to the native `connect` method: DatagramSocket has a work around to palliate the issue (it checks the local address, and if the port is 0, it calls `NET_bind` again. This appears to work on linux, but not on BSD.

      java.lang.AssertionError: local address after disconnect should be /127.0.0.1:48591 found /127.0.0.1:0

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: