< prev index next >

src/java.base/share/classes/java/net/doc-files/net-properties.html

Print this page




   6  This code is free software; you can redistribute it and/or modify it
   7  under the terms of the GNU General Public License version 2 only, as
   8  published by the Free Software Foundation.  Oracle designates this
   9  particular file as subject to the "Classpath" exception as provided
  10  by Oracle in the LICENSE file that accompanied this code.
  11 
  12  This code is distributed in the hope that it will be useful, but WITHOUT
  13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  version 2 for more details (a copy is included in the LICENSE file that
  16  accompanied this code).
  17 
  18  You should have received a copy of the GNU General Public License version
  19  2 along with this work; if not, write to the Free Software Foundation,
  20  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21 
  22  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  or visit www.oracle.com if you need additional information or have any
  24  questions.
  25 -->
  26 <HTML>
  27 <HEAD>
  28         <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
  29         <TITLE>Networking Properties</TITLE>
  30 </HEAD>
  31 <BODY LANG="en-US" DIR="LTR">
  32 <H1 style="text-align:center">Networking Properties</H1>
  33 <P>There are a few standard system properties used to
  34 alter the mechanisms and behavior of the various classes of the
  35 java.net package. Some are checked only once at startup of the VM,
  36 and therefore are best set using the -D option of the java command,
  37 while others have a more dynamic nature and can also be changed using
  38 the <a href="../../lang/System.html#setProperty(java.lang.String,%20java.lang.String)">System.setProperty()</a> API.
  39 The purpose of this document is to list
  40 and detail all of these properties.</P>
  41 <P>If there is no special note, a property value is checked every time it is used.</P>
  42 <a id="Ipv4IPv6"></a>
  43 <H2>IPv4 / IPv6</H2>
  44 <UL>
  45         <LI><P><B>java.net.preferIPv4Stack</B> (default: false)<BR>
  46         If IPv6 is available on the operating system the
  47         underlying native socket will be, by default, an IPv6 socket which
  48         lets applications connect to, and accept connections from, both
  49         IPv4 and IPv6 hosts. However, in the case an application would
  50         rather use IPv4 only sockets, then this property can be set to <B>true</B>.
  51         The implication is that it will not be possible for the application
  52         to communicate with IPv6 only hosts.</P>
  53         <LI><P><B>java.net.preferIPv6Addresses</B> (default: false)<BR>
  54         When dealing with a host which has both IPv4
  55         and IPv6 addresses, and if IPv6 is available on the operating
  56         system, the default behavior is to prefer using IPv4 addresses over
  57         IPv6 ones. This is to ensure backward compatibility, for example
  58         applications that depend on the representation of an IPv4 address




   6  This code is free software; you can redistribute it and/or modify it
   7  under the terms of the GNU General Public License version 2 only, as
   8  published by the Free Software Foundation.  Oracle designates this
   9  particular file as subject to the "Classpath" exception as provided
  10  by Oracle in the LICENSE file that accompanied this code.
  11 
  12  This code is distributed in the hope that it will be useful, but WITHOUT
  13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  version 2 for more details (a copy is included in the LICENSE file that
  16  accompanied this code).
  17 
  18  You should have received a copy of the GNU General Public License version
  19  2 along with this work; if not, write to the Free Software Foundation,
  20  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21 
  22  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  or visit www.oracle.com if you need additional information or have any
  24  questions.
  25 -->
  26 <HTML lang="EN">
  27 <HEAD>
  28         <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
  29         <TITLE>Networking Properties</TITLE>
  30 </HEAD>
  31 <BODY LANG="en-US" DIR="LTR">
  32 <H1 style="text-align:center">Networking Properties</H1>
  33 <P>There are a few standard system properties used to
  34 alter the mechanisms and behavior of the various classes of the
  35 java.net package. Some are checked only once at startup of the VM,
  36 and therefore are best set using the -D option of the java command,
  37 while others have a more dynamic nature and can also be changed using
  38 the <a href="../../lang/System.html#setProperty-java.lang.String-java.lang.String-">System.setProperty()</a> API.
  39 The purpose of this document is to list
  40 and detail all of these properties.</P>
  41 <P>If there is no special note, a property value is checked every time it is used.</P>
  42 <a id="Ipv4IPv6"></a>
  43 <H2>IPv4 / IPv6</H2>
  44 <UL>
  45         <LI><P><B>java.net.preferIPv4Stack</B> (default: false)<BR>
  46         If IPv6 is available on the operating system the
  47         underlying native socket will be, by default, an IPv6 socket which
  48         lets applications connect to, and accept connections from, both
  49         IPv4 and IPv6 hosts. However, in the case an application would
  50         rather use IPv4 only sockets, then this property can be set to <B>true</B>.
  51         The implication is that it will not be possible for the application
  52         to communicate with IPv6 only hosts.</P>
  53         <LI><P><B>java.net.preferIPv6Addresses</B> (default: false)<BR>
  54         When dealing with a host which has both IPv4
  55         and IPv6 addresses, and if IPv6 is available on the operating
  56         system, the default behavior is to prefer using IPv4 addresses over
  57         IPv6 ones. This is to ensure backward compatibility, for example
  58         applications that depend on the representation of an IPv4 address


< prev index next >