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

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

XMLWordPrintable

    • b18
    • linux

      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

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

              Created:
              Updated:
              Resolved: