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

unclear documentation of connect() with timeout of 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta2
    • generic
    • generic

      The javadoc for the connect() method in java.net.Socket
      says:

          /**
           * Connects this socket to the server with a specified timeout value.
           * A timeout value of zero means no timeout. The connection will then
           * block until established or an error occurs.
           ...
           */


      This is potentially confusing. Instead, we should document this
      with wording similar to the javadoc for setSoTimeout() which says:

          * A timeout of zero is interpreted as an infinite timeout.

      The same issue exists in java.net.SocketImpl for it's connect()
      method.

            jccollet Jean-Christophe Collet (Inactive)
            jdn Jeffrey Nisewanger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: