RFR: 8308593: Add Keepalive Extended Socket Options Support for Windows [v3]

Vyom Tewari vtewari at openjdk.org
Thu Jul 20 17:41:45 UTC 2023


On Thu, 20 Jul 2023 16:49:04 GMT, Terry Chow <duke at openjdk.org> wrote:

>> The PR adds support for the keepalive extended socket options on Windows. For TCP_KEEPIDLE and TCP_KEEPINTVL, these options are supported starting from Windows 10 version 1709. TCP_KEEPCNT is supported starting from Windows 10 version 1703. Information on these socket options can be found [here](https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options).
>> 
>> I've also corrected the `handleError()` function. On Windows, the error needs to be retrieved using `WSAGetLastError()` and error codes are prefixed with "WSA". Information on this can be found [here](https://learn.microsoft.com/en-us/windows/win32/winsock/error-codes-errno-h-errno-and-wsagetlasterror-2).
>> 
>>>The error codes returned by Windows Sockets are similar to UNIX socket error code constants, but the constants are all prefixed with WSA.
>> 
>>>Error codes set by Windows Sockets are not made available through the errno variable.
>> 
>> No new tests were added as the existing tests should cover this.
>
> Terry Chow has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updated copyright year

src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java line 93:

> 91:     private static native boolean getIpDontFragment0(int fd, boolean isIPv6) throws SocketException;
> 92:     private static native void setTcpkeepAliveProbes0(int fd, int value) throws SocketException;
> 93:     private static native int getTcpkeepAliveProbes0(int fd) throws SocketException;

there is inconsistency in function naming some place you use 'keep' and other places you use 'Keep', can you please make it consistence ?.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14232#discussion_r1269773509


More information about the net-dev mailing list