JDK-8272357 : Release Note: DatagramSocket Can Be Used Directly to Join Multicast Groups
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 17
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2021-08-12
  • Updated: 2021-12-05
  • Resolved: 2021-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17Resolved
Description
`java.net.DatagramSocket` has been updated in this release to add support for joining multicast groups. It now defines `joinGroup` and `leaveGroup` methods to join and leave multicast groups. The class level API documentation of `java.net.DatagramSocket` has been updated to explain how a plain `DatagramSocket` can be configured and used to join and leave multicast groups.

This change means that the `DatagramSocket` API can be used for multicast applications without needing to use the legacy `java.net.MulticastSocket` API. The `MulticastSocket` API works as before, although most of its methods are deprecated.

More information on the rationale of this change can be seen in the CSR JDK-8260667.