Skip to content
Permalink
Browse files

8237896: MulticastSocket should link to DatagramChannel as an alterna…

…tive for multicasting

MulticastSocket API documentation now includes some links to DatagramChannel.

Reviewed-by: alanb
  • Loading branch information
dfuch committed Jan 29, 2020
1 parent 9d5d2a2 commit e0901fb62743608fa0fb10eb8c8a8c6876da880d
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/java.base/share/classes/java/net/MulticastSocket.java
@@ -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 @@ public void leaveGroup(InetAddress mcastaddr) throws IOException {
* @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)

0 comments on commit e0901fb

Please sign in to comment.