|
30 | 30 | </HEAD>
|
31 | 31 | <BODY LANG="en-US" DIR="LTR">
|
32 | 32 | <H1 style="text-align:center">Networking Properties</H1>
|
33 |
| -<P>There are a few standard system properties used to |
| 33 | +<p> |
| 34 | +There are a few standard system properties used to |
34 | 35 | alter the mechanisms and behavior of the various classes of the
|
35 | 36 | java.net package. Some are checked only once at startup of the VM,
|
36 | 37 | and therefore are best set using the -D option of the java command,
|
37 | 38 | while others have a more dynamic nature and can also be changed using
|
38 | 39 | the <a href="../../lang/System.html#setProperty(java.lang.String,java.lang.String)">System.setProperty()</a> API.
|
39 | 40 | The purpose of this document is to list
|
40 | 41 | 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 | +<p> |
| 43 | +If there is no special note, a property value is checked every time it is used.</P> |
42 | 44 | <a id="Ipv4IPv6"></a>
|
43 | 45 | <H2>IPv4 / IPv6</H2>
|
44 | 46 | <UL>
|
@@ -240,5 +242,57 @@ <H2>Address Cache</H2>
|
240 | 242 | <P>Since these 2 properties are part of the security policy, they are
|
241 | 243 | not set by either the -D option or the {@code System.setProperty()} API,
|
242 | 244 | instead they are set as security properties.</P>
|
| 245 | +<a id="Unixdomain"></a> |
| 246 | +<H2>Unix domain sockets</H2> |
| 247 | +<p> |
| 248 | +Calling {@link java.nio.channels.ServerSocketChannel#bind(SocketAddress,int) ServerSocketChannel.bind} |
| 249 | +with a {@code null} address parameter will bind to an <i>automatically assigned</i> socket address. |
| 250 | +For Unix domain sockets, this means a unique path in some predefined system temporary directory. |
| 251 | +There are a number of system (and networking) properties that affect this behavior. |
| 252 | +<p> |
| 253 | +Unix domain socket addresses are limited in length to approximately 100 |
| 254 | +bytes (depending on the platform), it is important to ensure that the temporary directory's name |
| 255 | +together with the filename used for the socket (currently a name similar to |
| 256 | +{@code socket_1679697142}) does not exceed this limit. The following properties |
| 257 | +can be used to control the selection of this directory: |
| 258 | +<p> |
| 259 | +<ul> |
| 260 | + <li><p><b>{@systemProperty jdk.net.unixdomain.tmpdir}</b> This can be set as |
| 261 | + a networking property in {@code conf/net.properties} If set, this specifies the |
| 262 | + directory to use for automatically bound server socket addresses. On some platforms, |
| 263 | + (eg some Unix systems) this will have a predefined default value. On others, |
| 264 | + (eg Windows) there is no default value. Either way, it is always possible |
| 265 | + to override the networking property with a system property of the same name |
| 266 | + set on the command line. If neither of the networking nor system property |
| 267 | + are set, then some systems (eg Windows) may check a commonly used environment |
| 268 | + variable as temporary directory. |
| 269 | + <li><p><b>{@systemProperty java.io.tmpdir}</b> If the previous step fails to locate |
| 270 | + a directory to use, then the directory identified by the system property |
| 271 | + {@code java.io.tmpdir} is used. |
| 272 | +</ul> |
| 273 | +More information about the platform specific behavior can be seen in the |
| 274 | +{@code conf/net.properties} configuration file. |
| 275 | +<p> |
| 276 | +<i>Implicit</i> binding of a {@link java.nio.channels.SocketChannel SocketChannel} |
| 277 | +<p> |
| 278 | +If a client socket is connected to a remote destination without calling {@code bind} first, |
| 279 | +then the socket is <i>implicitly</i> bound. In this case, <i>Unix domain</i> sockets |
| 280 | +are <i>unnamed</i> (ie. their path is empty). This behavior is not affected by any |
| 281 | +system or networking properties. |
| 282 | +<p> |
| 283 | +<a id="EnhancedExceptions"></a> |
| 284 | +<H2>Enhanced exception messages</H2> |
| 285 | +By default, for security reasons, exception messages do not include potentially sensitive |
| 286 | +security information such as hostnames or Unix domain socket address paths. |
| 287 | +The following property can be used to relax this restriction, for debugging and other |
| 288 | +purposes. |
| 289 | +<ul> |
| 290 | + <li><p><b>{@systemProperty jdk.includeInExceptions}</b> This is typically set to |
| 291 | + a comma separated list of keywords that refer to exception types whose messages |
| 292 | + may be enhanced with more detailed information. If the value includes the string |
| 293 | + {@code hostInfo} then socket addresses will be included in exception message |
| 294 | + texts (eg hostnames, Unix domain socket address paths). |
| 295 | +</ul> |
| 296 | + |
243 | 297 | </BODY>
|
244 | 298 | </HTML>
|
0 commit comments