< prev index next >

src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java

Print this page
rev 55657 : 8227587: Add internal privileged System.loadLibrary
Reviewed-by: rriggs


  77     /* indicates connection reset state */
  78     private volatile boolean connectionReset;
  79 
  80     /* indicates whether impl is bound  */
  81     boolean isBound;
  82 
  83     /* indicates whether impl is connected  */
  84     volatile boolean isConnected;
  85 
  86    /* whether this Socket is a stream (TCP) socket or not (UDP)
  87     */
  88     protected boolean stream;
  89 
  90     /* whether this is a server or not */
  91     final boolean isServer;
  92 
  93     /**
  94      * Load net library into runtime.
  95      */
  96     static {
  97         java.security.AccessController.doPrivileged(
  98             new java.security.PrivilegedAction<>() {
  99                 public Void run() {
 100                     System.loadLibrary("net");
 101                     return null;
 102                 }
 103             });
 104     }
 105 
 106     private static volatile boolean checkedReusePort;
 107     private static volatile boolean isReusePortAvailable;
 108 
 109     /**
 110      * Tells whether SO_REUSEPORT is supported.
 111      */
 112     static boolean isReusePortAvailable() {
 113         if (!checkedReusePort) {
 114             isReusePortAvailable = isReusePortAvailable0();
 115             checkedReusePort = true;
 116         }
 117         return isReusePortAvailable;
 118     }
 119 
 120     AbstractPlainSocketImpl(boolean isServer) {
 121         this.isServer = isServer;
 122     }
 123 




  77     /* indicates connection reset state */
  78     private volatile boolean connectionReset;
  79 
  80     /* indicates whether impl is bound  */
  81     boolean isBound;
  82 
  83     /* indicates whether impl is connected  */
  84     volatile boolean isConnected;
  85 
  86    /* whether this Socket is a stream (TCP) socket or not (UDP)
  87     */
  88     protected boolean stream;
  89 
  90     /* whether this is a server or not */
  91     final boolean isServer;
  92 
  93     /**
  94      * Load net library into runtime.
  95      */
  96     static {
  97         jdk.internal.access.SharedSecrets.getJavaLangAccess().loadLibrary("net");






  98     }
  99 
 100     private static volatile boolean checkedReusePort;
 101     private static volatile boolean isReusePortAvailable;
 102 
 103     /**
 104      * Tells whether SO_REUSEPORT is supported.
 105      */
 106     static boolean isReusePortAvailable() {
 107         if (!checkedReusePort) {
 108             isReusePortAvailable = isReusePortAvailable0();
 109             checkedReusePort = true;
 110         }
 111         return isReusePortAvailable;
 112     }
 113 
 114     AbstractPlainSocketImpl(boolean isServer) {
 115         this.isServer = isServer;
 116     }
 117 


< prev index next >