RFR 8245194: Unix domain socket channel implementation

Chris Hegarty chris.hegarty at oracle.com
Thu Jul 9 14:14:05 UTC 2020



> On 8 Jul 2020, at 11:07, Michael McMahon <michael.x.mcmahon at oracle.com> wrote:
> 
>> ...
>> 
>> 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?

That works for me.

What is the signature of this method? `Optional<ProtocolFamily> protocolFamily()` - or something else? If not optional ( or null ), then what is the family of a channel created with the no-args open method? We had some offline discussion about UNSPEC, and if we add this method then it could be a reason to add an UNSPEC StandardProtocolFamily.

-Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200709/2cd4b2bb/attachment.htm>


More information about the nio-dev mailing list