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

Print this page




  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any
  23  questions.
  24 -->
  25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  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 ALIGN=CENTER>Networking Properties</H1>
  33 <P ALIGN=LEFT>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. The purpose of this document is to list
  39 and detail all of these properties.</P>
  40 <P>If there is no special note, a property value is checked every time it is used.</P>
  41 <a name="Ipv4IPv6"></a>
  42 <H2>IPv4 / IPv6</H2>
  43 <UL>
  44         <LI><P><B>java.net.preferIPv4Stack</B> (default: false)<BR>
  45         If IPv6 is available on the operating system the
  46         underlying native socket will be, by default, an IPv6 socket which
  47         lets applications connect to, and accept connections from, both
  48         IPv4 and IPv6 hosts. However, in the case an application would
  49         rather use IPv4 only sockets, then this property can be set to <B>true</B>.
  50         The implication is that it will not be possible for the application
  51         to communicate with IPv6 only hosts.</P>
  52         <LI><P><B>java.net.preferIPv6Addresses</B> (default: false)<BR>
  53         When dealing with a host which has both IPv4
  54         and IPv6 addresses, and if IPv6 is available on the operating
  55         system, the default behavior is to prefer using IPv4 addresses over
  56         IPv6 ones. This is to ensure backward compatibility, for example
  57         applications that depend on the representation of an IPv4 address
  58         (e.g. 192.168.1.1). This property can be set to <B>true</B> to




  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any
  23  questions.
  24 -->
  25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  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 ALIGN=CENTER>Networking Properties</H1>
  33 <P ALIGN=LEFT>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. The purpose of this document is to list
  39 and detail all of these properties.</P>
  40 <P>If there is no special note, a property value is checked every time it is used.</P>
  41 <a name="Ipv4IPv6"></a>
  42 <H2>IPv4 / IPv6</H2>
  43 <UL>
  44         <LI><P><B>java.net.preferIPv4Stack</B> (default: false)<BR>
  45         If IPv6 is available on the operating system the
  46         underlying native socket will be, by default, an IPv6 socket which
  47         lets applications connect to, and accept connections from, both
  48         IPv4 and IPv6 hosts. However, in the case an application would
  49         rather use IPv4 only sockets, then this property can be set to <B>true</B>.
  50         The implication is that it will not be possible for the application
  51         to communicate with IPv6 only hosts.</P>
  52         <LI><P><B>java.net.preferIPv6Addresses</B> (default: false)<BR>
  53         When dealing with a host which has both IPv4
  54         and IPv6 addresses, and if IPv6 is available on the operating
  55         system, the default behavior is to prefer using IPv4 addresses over
  56         IPv6 ones. This is to ensure backward compatibility, for example
  57         applications that depend on the representation of an IPv4 address
  58         (e.g. 192.168.1.1). This property can be set to <B>true</B> to