changeset 58808:79fe42b90d9c

8237896: MulticastSocket should link to DatagramChannel as an alternative for multicasting. Summary: MulticastSocket API documentation now includes some links to DatagramChannel. Reviewed-by: alanb
author dfuchs
date Wed, 29 Jan 2020 19:13:09 +0000
parents 9a36b6a6d502
children 32451e117389
files src/java.base/share/classes/java/net/MulticastSocket.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/net/MulticastSocket.java	Wed Jan 29 10:12:59 2020 -0800
+++ b/src/java.base/share/classes/java/net/MulticastSocket.java	Wed Jan 29 19:13:09 2020 +0000
@@ -26,6 +26,8 @@
 package java.net;
 
 import java.io.IOException;
+import java.nio.channels.DatagramChannel;
+import java.nio.channels.MulticastChannel;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Set;
@@ -121,6 +123,13 @@
  * </blockquote>
  * Additional (implementation specific) options may also be supported.
  *
+ * @apiNote {@link DatagramChannel} implements the {@link MulticastChannel} interface
+ *          and provides an alternative API for sending and receiving multicast datagrams.
+ *          The {@link MulticastChannel} API supports both {@linkplain
+ *          MulticastChannel#join(InetAddress, NetworkInterface) any-source} and
+ *          {@linkplain MulticastChannel#join(InetAddress, NetworkInterface, InetAddress)
+ *          source-specific} multicast.
+ *
  * @author Pavani Diwanji
  * @since 1.1
  */
@@ -438,6 +447,7 @@
      * @throws IllegalArgumentException if mcastaddr is {@code null} or is a
      *         SocketAddress subclass not supported by this socket
      * @see    SecurityManager#checkMulticast(InetAddress)
+     * @see    DatagramChannel#join(InetAddress, NetworkInterface)
      * @since  1.4
      */
     public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)