adding rsockets support into JDK
Alan Bateman
Alan.Bateman at oracle.com
Thu Nov 29 14:22:21 UTC 2018
On 29/11/2018 13:57, Chris Hegarty wrote:
> :
> 1) What is the behaviour, and does it need to be specified, if a socket
> of one family type is either bound or connected to an address of a
> different family type?
In the case of Socket/ServerSocket, the bind and connect methods specify
IAE when the SocketAddress is not supported. For
SocketChannel/ServerSocketChannel, UnsupportedAddressTypeException (a
specific IAE) is specified. So I think we are okay on this point.
>
> 2) Socket has a connect method that accepts a String host name, will
> the lookup of the host prefer IPv6 addresses when the Socket's family
> type is INET6?
>
I assume you mean the protected connect(String, int) method on
SocketImpl. Need to check but I think this may be limited to the case
where Socket's connect(SocketAddress) is called with an unresolved
address. But yes, the impl would need to do an InetAddress.getByName and
choose an Inet4Address or Inet6Address to match the protocol family. As
regards the spec then maybe we should separate this from this JEP as it
would mean clarifying the spec of a standard API.
-Alan
More information about the nio-dev
mailing list