RFR: 8376290: SocketChannel.finishConnect() contains confusing "getsockopt" in exception message for a failed connect() on Windows [v5]

Mark Sheppard msheppar at openjdk.org
Tue Jan 27 16:24:38 UTC 2026


On Tue, 27 Jan 2026 15:49:50 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> test/jdk/java/nio/channels/Selector/ConnectionRefusedMessage.java line 108:
>> 
>>> 106:         final InetAddress loopbackAddr = InetAddress.getLoopbackAddress();
>>> 107:         // port 47 is reserved - there should be nothing listening on it
>>> 108:         InetSocketAddress destAddr = new InetSocketAddress(loopbackAddr, 47);
>> 
>> a general comment on the dest port selections below, 47, 51, 61.
>> These are currently marked as reserved in the IANA port list, but if you look at the /etc/services file, on macos, you will see that there is a legacy assignment
>> 
>> As such, a comment in the test would be useful, such as,
>> 
>> // using ports 47, 51, 61 from the the IANA reserved port list, which
>> // are currently unassigned, on the assumption they will not used by
>> // a listening service
>
> Done, I've used your suggestion and updated that comment to be more descriptive.

cheers 👍

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29409#discussion_r2732819153


More information about the net-dev mailing list