< prev index next >

src/java.base/share/classes/sun/net/NetworkClient.java

Print this page




  48 
  49     protected Proxy     proxy = Proxy.NO_PROXY;
  50     /** Socket for communicating with server. */
  51     protected Socket    serverSocket = null;
  52 
  53     /** Stream for printing to the server. */
  54     public PrintStream  serverOutput;
  55 
  56     /** Buffered stream for reading replies from server. */
  57     public InputStream  serverInput;
  58 
  59     protected static int defaultSoTimeout;
  60     protected static int defaultConnectTimeout;
  61 
  62     protected int readTimeout = DEFAULT_READ_TIMEOUT;
  63     protected int connectTimeout = DEFAULT_CONNECT_TIMEOUT;
  64     /* Name of encoding to use for output */
  65     protected static String encoding;
  66 
  67     static {
  68         final int vals[] = {0, 0};
  69         final String encs[] = { null };
  70 
  71         AccessController.doPrivileged(
  72                 new PrivilegedAction<>() {
  73                     public Void run() {
  74                         vals[0] = Integer.getInteger("sun.net.client.defaultReadTimeout", 0).intValue();
  75                         vals[1] = Integer.getInteger("sun.net.client.defaultConnectTimeout", 0).intValue();
  76                         encs[0] = System.getProperty("file.encoding", "ISO8859_1");
  77                         return null;
  78             }
  79         });
  80         if (vals[0] != 0) {
  81             defaultSoTimeout = vals[0];
  82         }
  83         if (vals[1] != 0) {
  84             defaultConnectTimeout = vals[1];
  85         }
  86 
  87         encoding = encs[0];
  88         try {
  89             if (!isASCIISuperset (encoding)) {




  48 
  49     protected Proxy     proxy = Proxy.NO_PROXY;
  50     /** Socket for communicating with server. */
  51     protected Socket    serverSocket = null;
  52 
  53     /** Stream for printing to the server. */
  54     public PrintStream  serverOutput;
  55 
  56     /** Buffered stream for reading replies from server. */
  57     public InputStream  serverInput;
  58 
  59     protected static int defaultSoTimeout;
  60     protected static int defaultConnectTimeout;
  61 
  62     protected int readTimeout = DEFAULT_READ_TIMEOUT;
  63     protected int connectTimeout = DEFAULT_CONNECT_TIMEOUT;
  64     /* Name of encoding to use for output */
  65     protected static String encoding;
  66 
  67     static {
  68         final int[] vals = {0, 0};
  69         final String[] encs = { null };
  70 
  71         AccessController.doPrivileged(
  72                 new PrivilegedAction<>() {
  73                     public Void run() {
  74                         vals[0] = Integer.getInteger("sun.net.client.defaultReadTimeout", 0).intValue();
  75                         vals[1] = Integer.getInteger("sun.net.client.defaultConnectTimeout", 0).intValue();
  76                         encs[0] = System.getProperty("file.encoding", "ISO8859_1");
  77                         return null;
  78             }
  79         });
  80         if (vals[0] != 0) {
  81             defaultSoTimeout = vals[0];
  82         }
  83         if (vals[1] != 0) {
  84             defaultConnectTimeout = vals[1];
  85         }
  86 
  87         encoding = encs[0];
  88         try {
  89             if (!isASCIISuperset (encoding)) {


< prev index next >