RFR 8245194: Unix domain socket channel implementation

Michael McMahon michael.x.mcmahon at oracle.com
Wed Jul 8 10:07:30 UTC 2020


Hi Chris

Thanks for the review.

On 07/07/2020 15:18, Chris Hegarty wrote:
>
>> On 18 Jun 2020, at 15:31, Michael McMahon <michael.x.mcmahon at oracle.com> wrote:
>> ..
>>
>> Comments welcome on either the implementation or the API, although I would like to concentrate on the API to start with as I expect the review will have several iterations.
>>
> First off, this looks very good. And it seems that you have been able to weave Unix domain sockets into the existing API quite nicely.
>
> My initial reaction to seeing verbiage like "Internet protocol socket” and “unix domain socket”, is how does one know what type of socket channel one has if passed an unbound channel? I wonder if a SocketChannel::protocolFamily method is worth adding? It could be used and linked to from some of the verbiage elsewhere to tighten the spec. There could also be some tie in here with inheritedChannel - if the protocol family is retrievable.
I did consider that question and had concluded that testing the type of 
the SocketAddress returned by getLocalAddress() would suffice for this. 
But, you're right that does not work for unbound channels. I'll add this 
to the API for now (for SocketChannel and ServerSocketChannel in the 
sandbox), to see what it looks like. Perhaps, for consistency it should 
be added to DatagramChannel too?
> I would be good to explicitly mention that UnixDomainSocketAddress.of​(String), allows an empty path string. There is a definition of _unnamed_ in UDSA - which I like. But later in the channel’s spec the wording “with an empty path” is used. I wonder if we could use _unnamed_ in such places, and link back to its definition?
Ok
> I had some comments on the implementation and spec for the serial proxy of UDSA, but I just pushed these to the sandbox [1], so they’ll be incorporated in the next iteration.

Great, thanks


Michael


> -Chris.
>
> [1] https://hg.openjdk.java.net/jdk/sandbox/rev/481b20e7e9b2


More information about the nio-dev mailing list