adding rsockets support into JDK

Lu, Yingqi at
Tue Nov 20 17:08:49 UTC 2018

Hi Chris,

The IPv6 addresses work with rsocket when both server and client use IPv6 addresses. However, the IPv4-mapped addresses does not work. If IPv6 is enabled on RDMA adaptors (which I believe it does in majority of the cases), current JDK uses IPv6 by default. Then is needed if applications use IPv4 addresses.

I think SDP has a similar limitation.

Please let me know if you have any further questions.


>-----Original Message-----
>From: Chris Hegarty [mailto:chris.hegarty at]
>Sent: Tuesday, November 20, 2018 4:55 AM
>To: Lu, Yingqi < at>
>Cc: Brian Burkhalter <brian.burkhalter at>; Alan Bateman
><Alan.Bateman at>; Viswanathan, Sandhya
><sandhya.viswanathan at>; Aundhe, Shirish
><shirish.aundhe at>; nio-dev at; Kaczmarek, Eric
><eric.kaczmarek at>
>Subject: Re: adding rsockets support into JDK
>Thank you for the update. I’m still reviewing, but just on one point below.
>> On 20 Nov 2018, at 04:06, Lu, Yingqi < at> wrote:
>> Hi Chris,
>> Thank you for your quick feedback. I have uploaded version 18 of the
>> patch at
>> In this version, I have changed following items according to your suggestions:
>> ...
>> 4. In terms of adding for all the tests, I
>tested couple test cases without the flag and they return error. I think the
>reason is that Java uses IPv6 by default if kernel supports it. However rsocket
>does not support IPv4-mapped addresses. That is the reason why the flag is
>needed. Please let me know if there is anything I miss here though.
>Maybe I'm missing something, but if the rsocket implementation on Linux
>does not support IPv6 then why not just set the domain to AF_INET in the
>code. That is one implication of what is being achieved with
>` `. For example in
>nv *env, jobject this,
>                                            jboolean stream, jobject impl) {
>     jobject fdObj, ssObj;
>     int fd;
>     int type = (stream ? SOCK_STREAM : SOCK_DGRAM);
>     int domain = ipv6_available() ? AF_INET6 : AF_INET;  // <<< HERE
>     ...
>     if ((fd = rs_socket(domain, type, 0)) == -1) {
>     ...
> }
>Or does IPv6 work ok, just not for IPv4-mapped addresses? I'm trying to
>understand if IP protocol-specific configuration should be exposed in the
>factories for creating IP protocol-specific sockets and channels, similar to

More information about the nio-dev mailing list