RFR 8245194: Unix domain socket channel implementation

Daniel Fuchs daniel.fuchs at oracle.com
Thu Jul 16 15:28:57 UTC 2020


Hi Michael,

The package-info for java.net has a section about Addresses.
Given that UnixDomainSocketAddress is now in class in the
java.net package, I wonder if, for clarity, that section
(or the Socket section that comes after) should be updated
to say that java.net sockets only support the
Internet Protocol, and point to java.nio.channels for
channels supporting the UNIX domain protocol?

Maybe a sub-section "About UNIX domain" - similar to "About IPv6",
in either one of these two sections?

http://cr.openjdk.java.net/~michaelm/8245194/specdiff/specout.4/java.base/java/net/package-summary.html

Similarly - maybe UnixDomainSocketAddress could have an @see
pointing to the SocketChannel and ServerSocketChannel?


In 
http://cr.openjdk.java.net/~michaelm/8245194/specdiff/specout.4/java.base/java/nio/channels/ServerSocketChannel.html
two args bind method:

"SecurityException: If a security manager has been installed and its 
checkListen method denies the operation for an Internet protocol socket 
address or NetPermission("allowUnixDomainChannels") when the socket 
address is a Unix domain socket address"

It sounds like some words (verb?) are missing just before NetPermission?
Possibly a comma or semicolon after "for an Internet protocol socket 
address" could make the parsing easier too.


In 
http://cr.openjdk.java.net/~michaelm/8245194/specdiff/specout.4/java.base/java/nio/channels/SocketChannel.html
open(SocketAddress) method:

"UnresolvedAddressException - If the given remote -a-d-d-r-e-s-s- is an 
InetSocketAddress that is not fully resolved"

For consistency with the description of the method where "remote 
address" is used, I would not remove the "address" word here.

For the bind(SocketAddress), the @throws SecurityException clause seems
to have the same issue than outlined above for ServerSocketChannel.

Otherwise the spec look good to me. Nice job of implementing the
feature with such a small API surface!

best regards

-- daniel

On 16/07/2020 15:49, Michael McMahon wrote:
> Hi,
> 
> I have updated the API webrev [1], the complete webrev [2] and the 
> specdiff [3] from the review comments so far.
> 
> I've also made a couple of other small API changes I should mention.
> 
> - the package-info for java.nio.channels now refers to the 
> "java.net.preferIPv4Stack" property which has always affected its 
> behavior, but which wasn't clearly documented.
> 
> - the temporary directory used by automatically bound Unix Domain 
> ServerSocketChannels can be overridden using the "java.nio.tempdir" 
> system property. This is to overcome the problem where ${java.io.tmpdir} 
> points to a directory whose name is too long for Unix domain sockets.
> 
> Comments welcome.
> 
> Thanks,
> Michael.
> 
> [1] http://cr.openjdk.java.net/~michaelm/8245194/api.webrev/webrev.4/
> 
> [2] http://cr.openjdk.java.net/~michaelm/8245194/impl.webrev/webrev.4/
> 
> [3] 
> http://cr.openjdk.java.net/~michaelm/8245194/specdiff/specout.4/overview-summary.html 
> 
> 



More information about the nio-dev mailing list