Patch for adding SO_REUSEPORT socket option

Lu, Yingqi yingqi.lu at intel.com
Thu Jan 7 16:41:16 UTC 2016


Hi Alan,

In AbstractPlainSocketImpl, I am using the existing/default initializer so that there is only 1 initializer. However, it does not execute. That is the issue I am seeing.

Any suggestion on the issue?

Thanks,
Lucy

-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at oracle.com] 
Sent: Wednesday, January 06, 2016 7:38 AM
To: Lu, Yingqi <yingqi.lu at intel.com>; Volker Simonis <volker.simonis at gmail.com>
Cc: net-dev at openjdk.java.net; Viswanathan, Sandhya <sandhya.viswanathan at intel.com>; Kharbas, Kishor <kishor.kharbas at intel.com>; Aundhe, Shirish <shirish.aundhe at intel.com>; Kaczmarek, Eric <eric.kaczmarek at intel.com>
Subject: Re: Patch for adding SO_REUSEPORT socket option



On 05/01/2016 18:56, Lu, Yingqi wrote:
> Hi Alan,
>
> Sorry for the confusion. Let me be more detailed on the issue.
>
> In previous version of the patch, I added an initializer in SocketImpl.java to load the libnet.so since the isReusePortAvailable and its native implementation were there. Then, this time, I tried to move isReusePortAvailable and its native implementation declaration down to AbstractPlainSocketImpl therefore I removed the initializer block from SocketImpl.java as well. Inside AbstractPlainSocketImpl.java, there is already an initializer there by default to load the libnet.so. I was assuming it would just load the library and the code would work. However, I found out the initializer inside the AbstractPlainSocketimpl does not execute. After I add back the initializer to SocketImpl, the code works.
>
> My question is: Is this a reasonable approach to do it by keeping both initializers?
>
> Thanks very much for your help,
> Lucy
>
When you updated AbstractPlainSocketImpl then is the new initializer before or after the current initializer? They run in declaration order so I'm wondering if this is the issue you are running into.

-Alan


More information about the net-dev mailing list