Harmony
  1. Harmony
  2. HARMONY-6343

[classlib][nio]SocketChannel.connect() can return true in non-blocking mode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M12
    • Component/s: Classlib
    • Labels:
      None
    • Environment:
      AIX
    • Patch Info:
      Patch Available

      Description

      Many test cases of SocketChannelTest failed on AIX: the connect() function always return true when connect to server address (localhost) in non-blocking mode.
      However, the specification says "If this channel is in non-blocking mode then an invocation of this method initiates a non-blocking connection operation. If the connection is established immediately, as can happen with a local connection, then this method returns true. Otherwise this method returns false and the connection operation must later be completed by invoking the finishConnect method."

      But SocketChannelTest supposes that everytime connect() return false in non-blocking mode.

      There are bugs in SocketChannelTest.
      And SocketChannelImp also need a fix to change to right status if connect successful immediately.

        Activity

        Hide
        Ray Chen added a comment -

        Patch verified.

        Tim, Thank you for improving the patch.

        Show
        Ray Chen added a comment - Patch verified. Tim, Thank you for improving the patch.
        Hide
        Tim Ellison added a comment -

        Thanks Ray.

        A slightly modified version of your patch was applied at repo revision r819939. I maintained the logic but refactored the code to be a bit more readable.

        Please verify the patch.

        Show
        Tim Ellison added a comment - Thanks Ray. A slightly modified version of your patch was applied at repo revision r819939. I maintained the logic but refactored the code to be a bit more readable. Please verify the patch.

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Ray Chen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 48h
              48h
              Remaining:
              Remaining Estimate - 48h
              48h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development