jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
changeset 12047 320a714614e9
parent 10693 6e9ebed2e783
child 12538 211d6e82fe51
equal deleted inserted replaced
12046:378aa3362868 12047:320a714614e9
    24  */
    24  */
    25 package java.net;
    25 package java.net;
    26 
    26 
    27 import java.io.FileDescriptor;
    27 import java.io.FileDescriptor;
    28 import java.io.IOException;
    28 import java.io.IOException;
       
    29 import java.security.AccessController;
    29 import sun.net.ResourceManager;
    30 import sun.net.ResourceManager;
    30 
    31 
    31 /**
    32 /**
    32  * Abstract datagram and multicast socket implementation base class.
    33  * Abstract datagram and multicast socket implementation base class.
    33  * Note: This is not a public class, so that applets cannot call
    34  * Note: This is not a public class, so that applets cannot call
    49 
    50 
    50     /* cached socket options */
    51     /* cached socket options */
    51     private int multicastInterface = 0;
    52     private int multicastInterface = 0;
    52     private boolean loopbackMode = true;
    53     private boolean loopbackMode = true;
    53     private int ttl = -1;
    54     private int ttl = -1;
       
    55 
       
    56     private static final String os = AccessController.doPrivileged(
       
    57         new sun.security.action.GetPropertyAction("os.name")
       
    58     );
       
    59 
       
    60     /**
       
    61      * flag set if the native connect() call not to be used
       
    62      */
       
    63     private final static boolean connectDisabled = os.startsWith("Mac OS");
    54 
    64 
    55     /**
    65     /**
    56      * Load net library into runtime.
    66      * Load net library into runtime.
    57      */
    67      */
    58     static {
    68     static {
   347     protected abstract Object socketGetOption(int opt) throws SocketException;
   357     protected abstract Object socketGetOption(int opt) throws SocketException;
   348 
   358 
   349     protected abstract void connect0(InetAddress address, int port) throws SocketException;
   359     protected abstract void connect0(InetAddress address, int port) throws SocketException;
   350     protected abstract void disconnect0(int family);
   360     protected abstract void disconnect0(int family);
   351 
   361 
       
   362     protected boolean nativeConnectDisabled() {
       
   363         return connectDisabled;
       
   364     }
   352 }
   365 }