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

(dc spec) connect and disconnect methods should specify that they may block

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      There should be no behavioral change as this is simply a change to match the specification with the extant behavior.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Update specification of java.nio.channels.DatagramChannel methods connect and disconnect to indicate that they may block.

      Problem

      The DatagramChannel methods connect and disconnect may block if a read or write operation is in progress on the channel when they are invoked, but the specification does not state that this is the case.

      Solution

      Modify verbiage in DatagramChannel.connect and DatagramChannel.disconnect to indicate that they may block if a read or write operation is in progress at the moment they are invoked.

      Specification

      • connect

      Add this verbiage:

      Datagrams in the channel's {@linkplain java.net.StandardSocketOptions#SO_RCVBUF socket receive buffer}, which have not been {@linkplain #receive(ByteBuffer) received} before invoking this method, may be discarded.

      If another thread has already initiated a read or write operation upon this channel, then an invocation of this method will block until any such operation is complete.

      Remove this verbiage:

      It will not have any effect on read or write operations that are already in progress at the moment that it is invoked.

      • disconnect

      Add this sentence:

      If another thread has already initiated a read or write operation upon this channel, then an invocation of this method may block until any such operation is complete.

      Remove this verbiage:

      It will not have any effect on read or write operations that are already in progress at the moment that it is invoked.

      Please also refer to the (newest) attached webrev webrev-8146298.zip.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bpb Brian Burkhalter
              Reporter:
              webbuggrp Webbug Group
              Reviewed By:
              Alan Bateman, Chris Hegarty, Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: