adding rsockets support into JDK
Alan Bateman
Alan.Bateman at oracle.com
Fri Nov 30 16:53:04 UTC 2018
On 30/11/2018 12:35, Chris Hegarty wrote:
> :
>
> I requested this note since these sockets / channels will be the first
> such, that when created with an INET6 family will disallow IPv4
> addressing. While not strictly required, I think it is good to call this
> out clearly.
>
> For example DatagramChannel does not do this:
>
> jshell> var dc = DatagramChannel.open(StandardProtocolFamily.INET6)
> dc ==> sun.nio.ch.DatagramChannelImpl at 7e774085
>
> jshell> var addr = Inet6Address.getByName("127.0.0.1")
> addr ==> /127.0.0.1
>
> jshell> dc.bind(new InetSocketAddress(addr, 0))
> $10 ==> sun.nio.ch.DatagramChannelImpl at 7e774085
To demonstrate it with DatagramChannel you would need to open the open
the channel to an INET socket and then try to bind (or connect) to an
IPv6 address. This should throw the expected
UnsupportedAddressTypeException.
-Alan
More information about the nio-dev
mailing list