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

(so) Windows throws SocketException instead of returning false for failed connec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta3
    • generic
    • generic
    • Verified

      Windows returns true for successful SocketChannel connect()
      but it never returns false for a failed connection. It throws

                java.net.SocketException: No such file or directory

      when it cannot make the connection. This is the behavior in both
      blocking and non-blocking mode. It should return false in non-blocking mode.

      This has been observed in tests connecting to webservers or daytime
      servers.

      The attached test file, loops 2000 times to a daytime server, opening
      a socket channel, connecting, then closing a socket channel. Compile the
      test file and redirect the output to a file. Expected (normal) result
      is that a portion of the connect calls will return false. They do on
      Solaris but not on windows.

            mmcclosksunw Michael Mccloskey (Inactive)
            kpolomsksunw Krystyna Polomski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: