RFR: 8376290: SocketChannel.finishConnect() contains confusing "getsockopt" in exception message for a failed connect() on Windows [v2]
Jaikiran Pai
jpai at openjdk.org
Mon Jan 26 10:53:15 UTC 2026
On Mon, 26 Jan 2026 10:32:37 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - rename test to ConnectionRefusedMessage
>> - formatting
>
> src/java.base/windows/native/libnet/net_util_md.c line 165:
>
>> 163: jio_snprintf(fullMsg, sizeof(fullMsg), "%s: %s",
>> 164: (char *)winsock_errors[i].errString, msg);
>> 165: }
>
> Can you fix up the alignment of the 3rd param, it's a bit messed up with the edits.
Done - I updated it now to match the formatting in else block. Let me know if this requires any additional formatting change.
> test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java line 76:
>
>> (failed to retrieve contents of file, check the PR for context)
> I think the test will have to retry if "connected" returns true as it's too easy to have interference between tests on the same host.
Hello Alan, do you mean there could be something that could be listening on these "restricted" ports, after we ensured in `findSuitableRefusedAddress()` that there wasn't anyone listening there?
> test/jdk/java/nio/channels/Selector/FailedConnect.java line 49:
>
>> 47: * @run junit ${test.main.class}
>> 48: */
>> 49: class FailedConnect {
>
> Maybe rename to ConnectionRefusedMessage as this isn't a unit test for connect failing?
Done.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29409#discussion_r2727146106
PR Review Comment: https://git.openjdk.org/jdk/pull/29409#discussion_r2727142505
PR Review Comment: https://git.openjdk.org/jdk/pull/29409#discussion_r2727142942
More information about the net-dev
mailing list