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.bate...@oracle.com] Sent: Wednesday, January 06, 2016 7:38 AM To: Lu, Yingqi <yingqi...@intel.com>; Volker Simonis <volker.simo...@gmail.com> Cc: net-dev@openjdk.java.net; Viswanathan, Sandhya <sandhya.viswanat...@intel.com>; Kharbas, Kishor <kishor.khar...@intel.com>; Aundhe, Shirish <shirish.aun...@intel.com>; Kaczmarek, Eric <eric.kaczma...@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