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

(dc) Clarify implicit bind behavior of DatagramChannel

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      Three methods of DatagramChannel, connect, send, and receive, may implicitly bind the channel, if not already bound. All three method descriptions contain the following statement in their specification:

       "If this channel's socket is not bound then this method will first cause the socket to be bound to an address that is assigned automatically, as if invoking the bind method with a parameter of null."

      In the DatagramChannel implementation:

      1) both send and receive effectively invoke the bind method as described. Bind may fail if the caller does not have the required permission ( the permission is granted by default, but there is still a security manager checkListen call, and the default permissions can be overridden ).

      2) the connect method does not invoke bind. It instead relies on the native connect in the kernel to perform the implicit bind.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pconcannon Patrick Concannon
              Reporter:
              chegar Chris Hegarty
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: