Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit fad2cf5

Browse files
pconcannonAlanBatemanChrisHegartydfuch
committedMay 12, 2020
8241072: Reimplement the Legacy DatagramSocket API
Replace the underlying implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs with simpler and more modern implementations that are easy to maintain and debug. Co-authored-by: Alan Bateman <alan.bateman@oracle.com> Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com> Co-authored-by: Daniel Fuchs <daniel.fuchs@oracle.com> Reviewed-by: alanb, chegar, dfuchs
1 parent 3930460 commit fad2cf5

34 files changed

+1472
-903
lines changed
 

‎src/java.base/share/classes/java/net/DatagramSocket.java

+172-558
Large diffs are not rendered by default.

‎src/java.base/share/classes/java/net/DatagramSocketImpl.java

+19
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,25 @@
3232

3333
/**
3434
* Abstract datagram and multicast socket implementation base class.
35+
*
36+
* @implNote Sockets created with the {@code DatagramSocket} and {@code
37+
* MulticastSocket} public constructors historically delegated all socket
38+
* operations to a {@code DatagramSocketImpl} implementation named
39+
* "PlainDatagramSocketImpl". {@code DatagramSocket} and {@code MulticastSocket}
40+
* have since been changed to a new implementation based on {@code DatagramChannel}.
41+
* The JDK continues to ship with the older implementation to allow code to run
42+
* that depends on unspecified behavior that differs between the old and new
43+
* implementations. The old implementation will be used if the Java virtual
44+
* machine is started with the system property {@systemProperty
45+
* jdk.net.usePlainDatagramSocketImpl} set to use the old implementation. It may
46+
* also be set in the JDK's network configuration file, located in {@code
47+
* ${java.home}/conf/net.properties}. The value of the property is the string
48+
* representation of a boolean. If set without a value then it defaults to {@code
49+
* true}, hence running with {@code -Djdk.net.usePlainDatagramSocketImpl} or
50+
* {@code -Djdk.net.usePlainDatagramSocketImpl=true} will configure the Java
51+
* virtual machine to use the old implementation. The property and old
52+
* implementation will be removed in a future version.
53+
*
3554
* @author Pavani Diwanji
3655
* @since 1.1
3756
*/

0 commit comments

Comments
 (0)