[crac] RFR: Handle open file descriptors with configurable policies [v6]

Radim Vansa rvansa at openjdk.org
Fri Jun 16 14:16:29 UTC 2023


On Fri, 16 Jun 2023 12:52:26 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   cleanup
>
> src/java.base/share/classes/java/net/DatagramSocketImpl.java line 79:
> 
>> 77:     // We don't know the protocol family when this socket is created and FD allocated, but it's not UNIX
>> 78:     @SuppressWarnings("unused")
>> 79:     private final JDKSocketResource resource = new JDKSocketResource(this, StandardProtocolFamily.INET, () -> fd);
> 
> Is there family notion on java level? Having this comment, it seems we may stop considering family.

The family here is used to distinguish network sockets vs. unix sockets; IPv4 and IPv6 is handled identically. I have considered making the arg just boolean, but using `family` seemed more future proof. POSIX defines many more types...
In fact the IPv4/IPv6 is decided based on a static call on IPv6 support, so I could use a static helper method (would have to expose IPv6 availability, `Net.isIPv6Available` is package-private).

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

PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1232311357


More information about the crac-dev mailing list